File tree 2 files changed +5
-5
lines changed
src/test/run-make-fulldeps/intrinsic-unreachable
2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 1
- #![ feature( llvm_asm) ]
2
1
#![ crate_type="lib" ]
2
+ use std:: arch:: asm;
3
3
4
4
#[ deny( unreachable_code) ]
5
5
pub fn exit ( n : usize ) -> i32 {
6
6
unsafe {
7
7
// Pretend this asm is an exit() syscall.
8
- llvm_asm ! ( "" :: "r" ( n) :: "volatile" ) ;
9
- // Can't actually reach this point, but rustc doesn't know that.
8
+ asm ! ( "/*{0}*/" , in( reg) n) ;
10
9
}
11
10
// This return value is just here to generate some extra code for a return
12
11
// value, making it easier for the test script to detect whether the
Original file line number Diff line number Diff line change 1
- #![ feature( llvm_asm , core_intrinsics) ]
1
+ #![ feature( core_intrinsics) ]
2
2
#![ crate_type="lib" ]
3
+ use std:: arch:: asm;
3
4
4
5
use std:: intrinsics;
5
6
6
7
#[ allow( unreachable_code) ]
7
8
pub fn exit ( n : usize ) -> i32 {
8
9
unsafe {
9
10
// Pretend this asm is an exit() syscall.
10
- llvm_asm ! ( "" :: "r" ( n ) :: "volatile" ) ;
11
+ asm ! ( "/*{0}*/" , in ( reg ) n ) ;
11
12
intrinsics:: unreachable ( )
12
13
}
13
14
// This return value is just here to generate some extra code for a return
You can’t perform that action at this time.
0 commit comments