about summary refs log tree commit diff
path: root/tests/codegen/unwind-landingpad-cold.rs
blob: fa200bc300cf93800e7e0a140f7f7a2dbed73834 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//@ compile-flags: -Cno-prepopulate-passes
//@ needs-unwind
//@ min-llvm-version: 17.0.2
#![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();
}