blob: fff432e3e20cb5c3f9fc8c81f26bb710dd16c353 [file] [log] [blame]
/* { dg-do run { target x86_64*-*-* } } */
/* { dg-output "Value is: 5\r*\n" } */
#![feature(rustc_attrs)]
extern "C" {
fn printf(s: *const i8, ...);
}
#[rustc_builtin_macro]
macro_rules! asm {
() => {};
}
fn main() -> i32 {
let y: i32 = 4;
let x: i32;
// `inout` can also move values to different places
unsafe {
asm!("inc {}", inout(reg) y=>x);
}
unsafe {
printf("Value is: %i\n\0" as *const str as *const i8, x);
}
0
}