diff --git a/gcc/testsuite/rust/execute/torture/inline_asm_mov_x_5.rs b/gcc/testsuite/rust/execute/torture/inline_asm_mov_x_5_ARM.rs similarity index 90% rename from gcc/testsuite/rust/execute/torture/inline_asm_mov_x_5.rs rename to gcc/testsuite/rust/execute/torture/inline_asm_mov_x_5_ARM.rs index 4f1555e6f2d3..4e762608230f 100644 --- a/gcc/testsuite/rust/execute/torture/inline_asm_mov_x_5.rs +++ b/gcc/testsuite/rust/execute/torture/inline_asm_mov_x_5_ARM.rs @@ -1,3 +1,4 @@ +/* { dg-do run { target arm*-*-* } } */ /* { dg-output "5\r*\n" }*/ #![feature(rustc_attrs)] diff --git a/gcc/testsuite/rust/execute/torture/inline_asm_mov_x_5_x86_64.rs b/gcc/testsuite/rust/execute/torture/inline_asm_mov_x_5_x86_64.rs new file mode 100644 index 000000000000..c6086e00d460 --- /dev/null +++ b/gcc/testsuite/rust/execute/torture/inline_asm_mov_x_5_x86_64.rs @@ -0,0 +1,24 @@ +/* { dg-do run { target x86_64*-*-* } } */ +/* { dg-output "5\r*\n" }*/ + +#![feature(rustc_attrs)] +#[rustc_builtin_macro] +macro_rules! asm { + () => {}; +} + +extern "C" { + fn printf(s: *const i8, ...); +} + +fn main() -> i32 { + let mut _x: i32 = 0; + unsafe { + asm!( + "mov $5, {}", + out(reg) _x + ); + printf("%d\n\0" as *const str as *const i8, _x); + } + 0 +}