diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/codegen/slice-iter-fold.rs | 14 | ||||
| -rw-r--r-- | tests/codegen/vec-shrink-panik.rs | 8 |
2 files changed, 14 insertions, 8 deletions
diff --git a/tests/codegen/slice-iter-fold.rs b/tests/codegen/slice-iter-fold.rs new file mode 100644 index 00000000000..9391c176130 --- /dev/null +++ b/tests/codegen/slice-iter-fold.rs @@ -0,0 +1,14 @@ +// ignore-debug: the debug assertions get in the way +// compile-flags: -O +// min-llvm-version: 16 +#![crate_type = "lib"] + +// CHECK-LABEL: @slice_fold_to_last +#[no_mangle] +pub fn slice_fold_to_last(slice: &[i32]) -> Option<&i32> { + // CHECK-NOT: loop + // CHECK-NOT: br + // CHECK-NOT: call + // CHECK: ret + slice.iter().fold(None, |_, i| Some(i)) +} diff --git a/tests/codegen/vec-shrink-panik.rs b/tests/codegen/vec-shrink-panik.rs index 606d68ff3ab..14fef4e2cd5 100644 --- a/tests/codegen/vec-shrink-panik.rs +++ b/tests/codegen/vec-shrink-panik.rs @@ -38,14 +38,6 @@ pub fn issue71861(vec: Vec<u32>) -> Box<[u32]> { #[no_mangle] pub fn issue75636<'a>(iter: &[&'a str]) -> Box<[&'a str]> { // CHECK-NOT: panic - - // Call to panic_cannot_unwind in case of double-panic is expected, - // on LLVM 16 and older, but other panics are not. - // old: filter - // old-NEXT: ; call core::panicking::panic_cannot_unwind - // old-NEXT: panic_cannot_unwind - - // CHECK-NOT: panic iter.iter().copied().collect() } |
