Skip to content

Commit

Permalink
update vec-shrink-panik test to allow panic_no_unwind in landingpads
Browse files Browse the repository at this point in the history
  • Loading branch information
erikdesjardins committed Feb 28, 2022
1 parent 851fcc7 commit 0c78433
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/test/codegen/vec-shrink-panik.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,32 @@ pub fn shrink_to_fit(vec: &mut Vec<u32>) {
// CHECK-LABEL: @issue71861
#[no_mangle]
pub fn issue71861(vec: Vec<u32>) -> Box<[u32]> {
// CHECK-NOT: panic

// Call to panic_no_unwind in case of double-panic is expected,
// but other panics are not.
// CHECK: cleanup
// CHECK-NEXT: ; call core::panicking::panic_no_unwind
// CHECK-NEXT: panic_no_unwind

// CHECK-NOT: panic
vec.into_boxed_slice()
}

// CHECK-LABEL: @issue75636
#[no_mangle]
pub fn issue75636<'a>(iter: &[&'a str]) -> Box<[&'a str]> {
// CHECK-NOT: panic

// Call to panic_no_unwind in case of double-panic is expected,
// but other panics are not.
// CHECK: cleanup
// CHECK-NEXT: ; call core::panicking::panic_no_unwind
// CHECK-NEXT: panic_no_unwind

// CHECK-NOT: panic
iter.iter().copied().collect()
}

// CHECK: ; core::panicking::panic_no_unwind
// CHECK: declare void @{{.*}}panic_no_unwind

0 comments on commit 0c78433

Please sign in to comment.