2022-01-11 18:00:00 -06:00
|
|
|
#![feature(core_intrinsics)]
|
2014-09-04 18:09:18 -05:00
|
|
|
#![crate_type="lib"]
|
2022-01-11 18:00:00 -06:00
|
|
|
use std::arch::asm;
|
2014-09-04 18:09:18 -05:00
|
|
|
|
|
|
|
use std::intrinsics;
|
|
|
|
|
2017-11-10 17:32:06 -06:00
|
|
|
#[allow(unreachable_code)]
|
|
|
|
pub fn exit(n: usize) -> i32 {
|
2014-09-04 18:09:18 -05:00
|
|
|
unsafe {
|
|
|
|
// Pretend this asm is an exit() syscall.
|
2022-01-11 18:00:00 -06:00
|
|
|
asm!("/*{0}*/", in(reg) n);
|
2014-09-04 18:09:18 -05:00
|
|
|
intrinsics::unreachable()
|
|
|
|
}
|
2017-11-11 08:41:45 -06:00
|
|
|
// 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
|
|
|
|
// compiler deleted it.
|
2017-11-10 17:32:06 -06:00
|
|
|
42
|
2014-09-04 18:09:18 -05:00
|
|
|
}
|