Skip to content

Commit 064eda4

Browse files
committed
Migrate intrinsic-unreachable test to asm!
1 parent 02e6c64 commit 064eda4

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/test/run-make-fulldeps/intrinsic-unreachable/exit-ret.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
#![feature(llvm_asm)]
21
#![crate_type="lib"]
2+
use std::arch::asm;
33

44
#[deny(unreachable_code)]
55
pub fn exit(n: usize) -> i32 {
66
unsafe {
77
// 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);
109
}
1110
// This return value is just here to generate some extra code for a return
1211
// value, making it easier for the test script to detect whether the

src/test/run-make-fulldeps/intrinsic-unreachable/exit-unreachable.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
#![feature(llvm_asm, core_intrinsics)]
1+
#![feature(core_intrinsics)]
22
#![crate_type="lib"]
3+
use std::arch::asm;
34

45
use std::intrinsics;
56

67
#[allow(unreachable_code)]
78
pub fn exit(n: usize) -> i32 {
89
unsafe {
910
// Pretend this asm is an exit() syscall.
10-
llvm_asm!("" :: "r"(n) :: "volatile");
11+
asm!("/*{0}*/", in(reg) n);
1112
intrinsics::unreachable()
1213
}
1314
// This return value is just here to generate some extra code for a return

0 commit comments

Comments
 (0)