gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/reduc-8.c
raw| 1 | /* { dg-do compile } */ |
| 2 | /* { dg-additional-options "-march=rv32gcv -mabi=ilp32d -mrvv-vector-bits=scalable -ffast-math -fno-vect-cost-model -fdump-tree-optimized-details" } */ |
| 3 | |
| 4 | int __attribute__((noipa)) |
| 5 | add_loop (int *x, int n, int res) |
| 6 | { |
| 7 | for (int i = 0; i < n; ++i) |
| 8 | { |
| 9 | res += x[i * 2]; |
| 10 | res += x[i * 2 + 1]; |
| 11 | } |
| 12 | return res; |
| 13 | } |
| 14 | |
| 15 | /* { dg-final { scan-assembler-times {add\s+[a-x0-9]+,\s*[a-x0-9]+,a2} 1 } } */ |