blob: 082c9cb97fde82e6ada56541ae3bd35fed6f4a9c [file] [log] [blame]
// { dg-output "minus two!\r*\nelse\r*\n" }
#![feature(no_core)]
#![no_core]
extern "C" {
fn printf(s: *const i8, ...);
}
fn foo(x: i32) {
match x {
-2 => {
let a = "minus two!\n\0";
let b = a as *const str;
let c = b as *const i8;
unsafe {
printf(c);
}
}
_ => {
let a = "else\n\0";
let b = a as *const str;
let c = b as *const i8;
unsafe {
printf(c);
}
}
}
}
fn main() -> i32 {
foo(-2);
foo(2);
0
}