From ef24de24a82fe681581cc130f342363c47c0969a Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 7 Jun 2024 07:48:48 +0200 Subject: Merging upstream version 1.75.0+dfsg1. Signed-off-by: Daniel Baumann --- tests/codegen/unwind-landingpad-cold.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 tests/codegen/unwind-landingpad-cold.rs (limited to 'tests/codegen/unwind-landingpad-cold.rs') diff --git a/tests/codegen/unwind-landingpad-cold.rs b/tests/codegen/unwind-landingpad-cold.rs new file mode 100644 index 000000000..3a902a7d7 --- /dev/null +++ b/tests/codegen/unwind-landingpad-cold.rs @@ -0,0 +1,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) { + // this may unwind + f(); +} -- cgit v1.2.3