test: add test case
make tidy happy
let er = scalar.valid_range_exclusive(bx.cx());
if er.end != er.start
let er = scalar.valid_range_exclusive(bx.cx());
if er.end != er.start
- && scalar.valid_range.end() > scalar.valid_range.start()
+ && scalar.valid_range.end() >= scalar.valid_range.start()
{
// We want `table[e as usize ± k]` to not
// have bound checks, and this is the most
{
// We want `table[e as usize ± k]` to not
// have bound checks, and this is the most
--- /dev/null
+// compile-flags: -O
+// min-llvm-version: 11.0
+
+#![crate_type = "lib"]
+
+#[repr(C)]
+pub enum E {
+ A,
+}
+
+// CHECK-LABEL: @index
+#[no_mangle]
+pub fn index(x: &[u32; 3], ind: E) -> u32{
+ // CHECK-NOT: panic_bounds_check
+ x[ind as usize]
+}