rust/tests/codegen/unwind-landingpad-cold.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
415 B
Rust
Raw Permalink Normal View History

//@ compile-flags: -Cno-prepopulate-passes
//@ needs-unwind
#![crate_type = "lib"]
// This test checks that drop calls in unwind landing pads
// get the `cold` attribute.
// CHECK-LABEL: @check_cold
// CHECK: {{(call|invoke) void .+}}drop_in_place{{.+}} [[ATTRIBUTES:#[0-9]+]]
// CHECK: attributes [[ATTRIBUTES]] = { cold }
#[no_mangle]
pub fn check_cold(f: fn(), x: Box<u32>) {
// this may unwind
f();
}