aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/const5.rs
blob: 1965f8e7951fe8f937976642ecf8367ad40a5017 (plain)
1
2
3
4
5
// { dg-options "-w -O0 -fdump-tree-gimple" }
const A: usize = 123;
const B: [i32; 5] = [1, 2, 3, 4, 5];
const C: i32 = B[A];
// { dg-error "array subscript value .123. is outside the bounds of array" "" { target *-*-* } .-1 }