]> git.lizzy.rs Git - rust.git/blob - tests/codegen/cold-call-declare-and-call.rs
Rollup merge of #107190 - fmease:fix-81698, r=compiler-errors
[rust.git] / tests / codegen / cold-call-declare-and-call.rs
1 // compile-flags: -C no-prepopulate-passes
2
3 #![crate_type = "lib"]
4 #![feature(rust_cold_cc)]
5
6 // wasm marks the definition as `dso_local`, so allow that as optional.
7
8 // CHECK: define{{( dso_local)?}} coldcc void @this_should_never_happen(i16
9 // CHECK: call coldcc void @this_should_never_happen(i16
10
11 #[no_mangle]
12 pub extern "rust-cold" fn this_should_never_happen(x: u16) {}
13
14 pub fn do_things(x: u16) {
15     if x == 12345 {
16         this_should_never_happen(54321);
17     }
18 }