gcc/testsuite/gcc.target/riscv/rvv/base/pr117990-run-1.c
raw| 1 | /* { dg-do run { target { riscv_v } } } */ |
| 2 | /* { dg-additional-options "-std=c99" } */ |
| 3 | |
| 4 | #define STEP 10 |
| 5 | |
| 6 | char d[225]; |
| 7 | int e[STEP]; |
| 8 | |
| 9 | int main() { |
| 10 | // store 0, 10, 20, 30, 40, 50, 60, 70, 80, 90 |
| 11 | for (long h = 0; h < STEP; ++h) |
| 12 | d[h * STEP] = 9; |
| 13 | |
| 14 | // load 30, 40, 50, 60, 70, 80, 90 |
| 15 | // store 3, 4, 5, 6, 7, 8, 9 |
| 16 | for (int h = 3; h < STEP; h += 1) |
| 17 | e[h] = d[h * STEP]; |
| 18 | |
| 19 | if (e[5] != 9) { |
| 20 | __builtin_abort (); |
| 21 | } |
| 22 | |
| 23 | return 0; |
| 24 | } |