Skip to content

Commit 3183443

Browse files
committed
Make expectation in panic-in-drop-abort.rs test more precise
Check whether a call/invoke of the function exists, but don't match a leftover function declaration. Also remove the CHECK-LABELs: In panic-in-drop=unwind mode the call will not actually be in either of those functions, so remove the restriction and look for any calls.
1 parent 074bbc6 commit 3183443

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/test/codegen/panic-in-drop-abort.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
// Ensure that unwinding code paths are eliminated from the output after
44
// optimization.
55

6+
// CHECK-NOT: {{(call|invoke).*}}should_not_appear_in_output
7+
68
#![crate_type = "lib"]
79
use std::any::Any;
810
use std::mem::forget;
@@ -35,17 +37,13 @@ impl Drop for AssertNeverDrop {
3537
}
3638
}
3739

38-
// CHECK-LABEL: normal_drop
39-
// CHECK-NOT: should_not_appear_in_output
4040
#[no_mangle]
4141
pub fn normal_drop(x: ExternDrop) {
4242
let guard = AssertNeverDrop;
4343
drop(x);
4444
forget(guard);
4545
}
4646

47-
// CHECK-LABEL: indirect_drop
48-
// CHECK-NOT: should_not_appear_in_output
4947
#[no_mangle]
5048
pub fn indirect_drop(x: Box<dyn Any>) {
5149
let guard = AssertNeverDrop;

0 commit comments

Comments
 (0)