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