]>
Commit | Line | Data |
---|---|---|
5099ac24 | 1 | #![feature(core_intrinsics)] |
1a4d82fc | 2 | #![crate_type="lib"] |
5099ac24 | 3 | use std::arch::asm; |
223e47cc | 4 | |
1a4d82fc | 5 | use std::intrinsics; |
970d7e83 | 6 | |
abe05a73 XL |
7 | #[allow(unreachable_code)] |
8 | pub fn exit(n: usize) -> i32 { | |
970d7e83 | 9 | unsafe { |
1a4d82fc | 10 | // Pretend this asm is an exit() syscall. |
5099ac24 | 11 | asm!("/*{0}*/", in(reg) n); |
1a4d82fc | 12 | intrinsics::unreachable() |
970d7e83 | 13 | } |
abe05a73 XL |
14 | // This return value is just here to generate some extra code for a return |
15 | // value, making it easier for the test script to detect whether the | |
16 | // compiler deleted it. | |
17 | 42 | |
223e47cc | 18 | } |