1 // This test case checks that slice::{r}position functions do not
2 // prevent optimizing away bounds checks
10 pub fn test(y: &[u32], x: &u32, z: &u32) -> bool {
11 let result = match y.iter().position(|a| a == x) {
16 if let Ok(p) = result {
24 // CHECK-LABEL: @rtest
26 pub fn rtest(y: &[u32], x: &u32, z: &u32) -> bool {
27 let result = match y.iter().rposition(|a| a == x) {
32 if let Ok(p) = result {