Migrate intrinsic-unreachable test to asm!
This commit is contained in:
parent
02e6c64a04
commit
064eda47f1
2 changed files with 5 additions and 5 deletions
|
|
@ -1,12 +1,11 @@
|
|||
#![feature(llvm_asm)]
|
||||
#![crate_type="lib"]
|
||||
use std::arch::asm;
|
||||
|
||||
#[deny(unreachable_code)]
|
||||
pub fn exit(n: usize) -> i32 {
|
||||
unsafe {
|
||||
// Pretend this asm is an exit() syscall.
|
||||
llvm_asm!("" :: "r"(n) :: "volatile");
|
||||
// Can't actually reach this point, but rustc doesn't know that.
|
||||
asm!("/*{0}*/", in(reg) n);
|
||||
}
|
||||
// This return value is just here to generate some extra code for a return
|
||||
// value, making it easier for the test script to detect whether the
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#![feature(llvm_asm, core_intrinsics)]
|
||||
#![feature(core_intrinsics)]
|
||||
#![crate_type="lib"]
|
||||
use std::arch::asm;
|
||||
|
||||
use std::intrinsics;
|
||||
|
||||
|
|
@ -7,7 +8,7 @@ use std::intrinsics;
|
|||
pub fn exit(n: usize) -> i32 {
|
||||
unsafe {
|
||||
// Pretend this asm is an exit() syscall.
|
||||
llvm_asm!("" :: "r"(n) :: "volatile");
|
||||
asm!("/*{0}*/", in(reg) n);
|
||||
intrinsics::unreachable()
|
||||
}
|
||||
// This return value is just here to generate some extra code for a return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue