1 // This test case checks that slice::{r}position functions do not
2 // prevent optimizing away bounds checks
5 // ignore-debug: the debug assertions get in the way
11 pub fn test(y: &[u32], x: &u32, z: &u32) -> bool {
12 let result = match y.iter().position(|a| a == x) {
17 if let Ok(p) = result {
25 // CHECK-LABEL: @rtest
27 pub fn rtest(y: &[u32], x: &u32, z: &u32) -> bool {
28 let result = match y.iter().rposition(|a| a == x) {
33 if let Ok(p) = result {