-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
1 parent
3aca66b
commit e4953b4
Showing
2 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
...ust/execute/torture/inline_asm_mov_x_5.rs → ...execute/torture/inline_asm_mov_x_5_ARM.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/* { dg-do run { target arm*-*-* } } */ | ||
/* { dg-output "5\r*\n" }*/ | ||
|
||
#![feature(rustc_attrs)] | ||
|
24 changes: 24 additions & 0 deletions
24
gcc/testsuite/rust/execute/torture/inline_asm_mov_x_5_x86_64.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} |