aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/issue-1323-2.rs
blob: 45168b22fa729f56c0fe737e3ffba2b6c25ffd24 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
fn print_int(value: i32) {
    let s = "%d\n\0";
    let s_p = s as *const str;
    let c_p = s_p as *const i8;
    unsafe {
        printf(c_p, value as isize);
    }
}

fn main() {
    print_int(5);
}

extern "C" {
    fn printf(s: *const i8, ...);
}