]>
Commit | Line | Data |
---|---|---|
29967ef6 XL |
1 | // This test checks that bounds checks are elided when |
2 | // index is part of a (x | y) < C style condition | |
3 | ||
29967ef6 XL |
4 | // compile-flags: -O |
5 | ||
6 | #![crate_type = "lib"] | |
7 | ||
8 | // CHECK-LABEL: @get | |
9 | #[no_mangle] | |
10 | pub fn get(array: &[u8; 8], x: usize, y: usize) -> u8 { | |
11 | if x > 7 || y > 7 { | |
12 | 0 | |
13 | } else { | |
14 | // CHECK-NOT: panic_bounds_check | |
15 | array[y] | |
16 | } | |
17 | } |