]> git.proxmox.com Git - rustc.git/blob - tests/run-make-fulldeps/intrinsic-unreachable/exit-ret.rs
New upstream version 1.69.0+dfsg1
[rustc.git] / tests / run-make-fulldeps / intrinsic-unreachable / exit-ret.rs
1 #![crate_type="lib"]
2 use std::arch::asm;
3
4 #[deny(unreachable_code)]
5 pub fn exit(n: usize) -> i32 {
6 unsafe {
7 // Pretend this asm is an exit() syscall.
8 asm!("/*{0}*/", in(reg) n);
9 }
10 // This return value is just here to generate some extra code for a return
11 // value, making it easier for the test script to detect whether the
12 // compiler deleted it.
13 42
14 }