aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/execute/torture/helloworld2.rs
blob: 912301bcb26df8cdc78bd791b313c5cce5509f4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* { dg-output "Hello World 123\r*\n" }*/
extern "C" {
    fn printf(s: *const i8, ...);
}

fn main() -> i32 {
    unsafe {
        let a = "Hello World %i\n";
        let b = a as *const str;
        let c = b as *const i8;

        printf(c, 123);
    }
    0
}