File tree Expand file tree Collapse file tree 2 files changed +47
-0
lines changed
gcc/testsuite/rust/execute Expand file tree Collapse file tree 2 files changed +47
-0
lines changed Original file line number Diff line number Diff line change 1+ /* { dg-output "Value is: 5\r*\n" } */
2+ #![ feature( rustc_attrs) ]
3+
4+ extern "C" {
5+ fn printf ( s : * const i8 , ...) ;
6+ }
7+
8+ #[ rustc_builtin_macro]
9+ macro_rules! asm {
10+ ( ) => { } ;
11+ }
12+
13+ fn main ( ) -> i32 {
14+ let x: i32 ;
15+ // `inout` can also move values to different places
16+ unsafe {
17+ asm ! ( "inc {}" , inout( reg) 4u64 =>x) ;
18+ }
19+ unsafe {
20+ printf ( "Value is: %i\n \0 " as * const str as * const i8 , x) ;
21+ }
22+ 0
23+ }
Original file line number Diff line number Diff line change 1+ /* { dg-output "Value is: 5\r*\n" } */
2+ #![ feature( rustc_attrs) ]
3+
4+ extern "C" {
5+ fn printf ( s : * const i8 , ...) ;
6+ }
7+
8+ #[ rustc_builtin_macro]
9+ macro_rules! asm {
10+ ( ) => { } ;
11+ }
12+
13+ fn main ( ) -> i32 {
14+ let y: i32 = 4 ;
15+ let x: i32 ;
16+ // `inout` can also move values to different places
17+ unsafe {
18+ asm ! ( "inc {}" , inout( reg) y=>x) ;
19+ }
20+ unsafe {
21+ printf ( "Value is: %i\n \0 " as * const str as * const i8 , x) ;
22+ }
23+ 0
24+ }
You can’t perform that action at this time.
0 commit comments