gcc/testsuite/gcc.target/riscv/rvv/autovec/pr112855.c
raw| 1 | /* { dg-do run } */ |
| 2 | /* { dg-options "-O3" } */ |
| 3 | /* { dg-require-effective-target rv64 } */ |
| 4 | /* { dg-require-effective-target riscv_v } */ |
| 5 | |
| 6 | #include <assert.h> |
| 7 | int a; |
| 8 | int b = 100; |
| 9 | int c[25]; |
| 10 | int d; |
| 11 | int main() { |
| 12 | int e; |
| 13 | d = 0; |
| 14 | for (; d < 5; d++) { |
| 15 | e = 0; |
| 16 | for (; e < 5; e++) |
| 17 | c[d * 5 + e] = 0; |
| 18 | } |
| 19 | if (b) |
| 20 | if (a) |
| 21 | for (;;) |
| 22 | ; |
| 23 | b++; |
| 24 | int volatile f = *c; |
| 25 | assert(b == 101); |
| 26 | } |