Skip to content

Commit 44942ad

Browse files
authored
Rollup merge of #109394 - krasimirgg:llvm-17-vec-panic, r=nikic
adapt tests/codegen/vec-shrink-panik for LLVM 17 After llvm/llvm-project@0d4a709 LLVM now doesn't generate references to panic_cannot_unwind: https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/17978#0186ff55-ca6f-4bc5-b1ec-2622c77d0ed5/744-746 Adapted as suggested by ````@nikic```` on Zulip: https://rust-lang.zulipchat.com/#narrow/stream/187780-t-compiler.2Fwg-llvm/topic/a.20couple.20codegen.20test.20failures.20after.20llvm.200d4a709bb876824a/near/342664944 >Okay, so LLVM now realizes that double panic is not possible, so that's fine.
2 parents 9545ab8 + e4a4064 commit 44942ad

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

tests/codegen/vec-shrink-panik.rs

+14-9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// revisions: old new
2+
// LLVM 17 realizes double panic is not possible and doesn't generate calls
3+
// to panic_cannot_unwind.
4+
// [old]ignore-llvm-version: 17 - 99
5+
// [new]min-llvm-version: 17
16
// compile-flags: -O
27
// ignore-debug: the debug assertions get in the way
38
#![crate_type = "lib"]
@@ -18,11 +23,11 @@ pub fn shrink_to_fit(vec: &mut Vec<u32>) {
1823
pub fn issue71861(vec: Vec<u32>) -> Box<[u32]> {
1924
// CHECK-NOT: panic
2025

21-
// Call to panic_cannot_unwind in case of double-panic is expected,
22-
// but other panics are not.
26+
// Call to panic_cannot_unwind in case of double-panic is expected
27+
// on LLVM 16 and older, but other panics are not.
2328
// CHECK: cleanup
24-
// CHECK-NEXT: ; call core::panicking::panic_cannot_unwind
25-
// CHECK-NEXT: panic_cannot_unwind
29+
// old-NEXT: ; call core::panicking::panic_cannot_unwind
30+
// old-NEXT: panic_cannot_unwind
2631

2732
// CHECK-NOT: panic
2833
vec.into_boxed_slice()
@@ -34,14 +39,14 @@ pub fn issue75636<'a>(iter: &[&'a str]) -> Box<[&'a str]> {
3439
// CHECK-NOT: panic
3540

3641
// Call to panic_cannot_unwind in case of double-panic is expected,
37-
// but other panics are not.
42+
// on LLVM 16 and older, but other panics are not.
3843
// CHECK: cleanup
39-
// CHECK-NEXT: ; call core::panicking::panic_cannot_unwind
40-
// CHECK-NEXT: panic_cannot_unwind
44+
// old-NEXT: ; call core::panicking::panic_cannot_unwind
45+
// old-NEXT: panic_cannot_unwind
4146

4247
// CHECK-NOT: panic
4348
iter.iter().copied().collect()
4449
}
4550

46-
// CHECK: ; core::panicking::panic_cannot_unwind
47-
// CHECK: declare void @{{.*}}panic_cannot_unwind
51+
// old: ; core::panicking::panic_cannot_unwind
52+
// old: declare void @{{.*}}panic_cannot_unwind

0 commit comments

Comments
 (0)