]> git.proxmox.com Git - rustc.git/blame - tests/run-make/intrinsic-unreachable/exit-unreachable.rs
Merge 1.70 into proxmox/bookworm
[rustc.git] / tests / run-make / intrinsic-unreachable / exit-unreachable.rs
CommitLineData
5099ac24 1#![feature(core_intrinsics)]
1a4d82fc 2#![crate_type="lib"]
5099ac24 3use std::arch::asm;
223e47cc 4
1a4d82fc 5use std::intrinsics;
970d7e83 6
abe05a73
XL
7#[allow(unreachable_code)]
8pub 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}