diff options
| author | Tomasz Miąsko <tomasz.miasko@gmail.com> | 2022-01-12 00:00:00 +0000 |
|---|---|---|
| committer | Tomasz Miąsko <tomasz.miasko@gmail.com> | 2022-01-12 18:51:32 +0100 |
| commit | 064eda47f126563e916156a618dc57972afeffa6 (patch) | |
| tree | e567c72a59a6e3940e6b71b8e9780b816c6b83fd | |
| parent | 02e6c64a046eaaed36944888b7f01a508cb31669 (diff) | |
| download | rust-064eda47f126563e916156a618dc57972afeffa6.tar.gz rust-064eda47f126563e916156a618dc57972afeffa6.zip | |
Migrate intrinsic-unreachable test to asm!
| -rw-r--r-- | src/test/run-make-fulldeps/intrinsic-unreachable/exit-ret.rs | 5 | ||||
| -rw-r--r-- | src/test/run-make-fulldeps/intrinsic-unreachable/exit-unreachable.rs | 5 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/test/run-make-fulldeps/intrinsic-unreachable/exit-ret.rs b/src/test/run-make-fulldeps/intrinsic-unreachable/exit-ret.rs index 2e81667cf39..e7b9694d9f2 100644 --- a/src/test/run-make-fulldeps/intrinsic-unreachable/exit-ret.rs +++ b/src/test/run-make-fulldeps/intrinsic-unreachable/exit-ret.rs @@ -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 diff --git a/src/test/run-make-fulldeps/intrinsic-unreachable/exit-unreachable.rs b/src/test/run-make-fulldeps/intrinsic-unreachable/exit-unreachable.rs index fb3848b0db6..ec85db733df 100644 --- a/src/test/run-make-fulldeps/intrinsic-unreachable/exit-unreachable.rs +++ b/src/test/run-make-fulldeps/intrinsic-unreachable/exit-unreachable.rs @@ -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 |
