2022-03-10 16:10:36 -06:00
|
|
|
// compile-flags: -Cno-prepopulate-passes
|
2023-08-08 04:28:37 -05:00
|
|
|
// needs-unwind
|
2023-10-02 03:45:49 -05:00
|
|
|
// min-llvm-version: 17.0.2
|
2022-03-10 16:10:36 -06:00
|
|
|
#![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();
|
|
|
|
}
|