Debian Codegraph @

gcc/testsuite/gcc.dg/vect/costmodel/riscv/rvv/pr111153-1.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-march=rv64gcv -mabi=lp64d -O3 -ftree-vectorize -mtune=generic-ooo -ffast-math" } */
3
4 #define DEF_REDUC_PLUS(TYPE) \
5 TYPE __attribute__ ((noinline, noclone)) \
6 reduc_plus_##TYPE (TYPE *__restrict a, int n) \
7 { \
8 TYPE r = 0; \
9 for (int i = 0; i < n; ++i) \
10 r += a[i]; \
11 return r; \
12 }
13
14 #define TEST_PLUS(T) T (int) T (float)
15
16 TEST_PLUS (DEF_REDUC_PLUS)
17
18 /* { dg-final { scan-assembler-not {vsetivli\s+zero,\s*4} } } */