2022-01-11 18:00:00 -06:00
|
|
|
#![feature(core_intrinsics)]
|
2024-05-29 00:01:33 -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)]
|
2023-10-06 19:29:42 -05:00
|
|
|
#[inline(never)]
|
2017-11-10 17:32:06 -06:00
|
|
|
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
|
|
|
}
|