From ca839781c9e121d80b19844b36967c2e14eaacb3 Mon Sep 17 00:00:00 2001 From: badumbatish Date: Sat, 31 Aug 2024 23:37:19 -0700 Subject: gccrs: Provide new asm test case for amd64 gcc/testsuite/ChangeLog: * rust/execute/torture/inline_asm_mov_x_5.rs: Move to... * rust/execute/torture/inline_asm_mov_x_5_ARM.rs: ...here. * rust/execute/torture/inline_asm_mov_x_5_x86_64.rs: New test. --- .../rust/execute/torture/inline_asm_mov_x_5.rs | 23 --------------------- .../rust/execute/torture/inline_asm_mov_x_5_ARM.rs | 24 ++++++++++++++++++++++ .../execute/torture/inline_asm_mov_x_5_x86_64.rs | 24 ++++++++++++++++++++++ 3 files changed, 48 insertions(+), 23 deletions(-) delete mode 100644 gcc/testsuite/rust/execute/torture/inline_asm_mov_x_5.rs create mode 100644 gcc/testsuite/rust/execute/torture/inline_asm_mov_x_5_ARM.rs create mode 100644 gcc/testsuite/rust/execute/torture/inline_asm_mov_x_5_x86_64.rs (limited to 'gcc') 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.rs deleted file mode 100644 index 4f1555e..0000000 --- a/gcc/testsuite/rust/execute/torture/inline_asm_mov_x_5.rs +++ /dev/null @@ -1,23 +0,0 @@ -/* { 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 -} diff --git a/gcc/testsuite/rust/execute/torture/inline_asm_mov_x_5_ARM.rs b/gcc/testsuite/rust/execute/torture/inline_asm_mov_x_5_ARM.rs new file mode 100644 index 0000000..4e76260 --- /dev/null +++ b/gcc/testsuite/rust/execute/torture/inline_asm_mov_x_5_ARM.rs @@ -0,0 +1,24 @@ +/* { dg-do run { target arm*-*-* } } */ +/* { 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 +} 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 0000000..c6086e0 --- /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 +} -- cgit v1.1