diff options
author | Philip Herron <philip.herron@embecosm.com> | 2022-08-25 13:46:27 +0100 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2022-08-25 13:46:39 +0100 |
commit | c52268c6d22bcecef596dffd3c31b78d225f59b6 (patch) | |
tree | 6faa9bca8c41d56010ab84fb309028bafd666fec /gcc | |
parent | 49cddf6e588f443262958a60e0444abc4945834d (diff) | |
download | gcc-c52268c6d22bcecef596dffd3c31b78d225f59b6.zip gcc-c52268c6d22bcecef596dffd3c31b78d225f59b6.tar.gz gcc-c52268c6d22bcecef596dffd3c31b78d225f59b6.tar.bz2 |
Add testcase for const array index expressions
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/rust/compile/const5.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/testsuite/rust/compile/const5.rs b/gcc/testsuite/rust/compile/const5.rs new file mode 100644 index 0000000..1965f8e --- /dev/null +++ b/gcc/testsuite/rust/compile/const5.rs @@ -0,0 +1,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 } |