[AArch64] Fix SVE testsuite failures for ILP32 (PR 83846)
[official-gcc.git] / gcc / testsuite / gcc.target / aarch64 / sve / slp_1_run.c
blob0ce056acfdf54def68ad8b74969cee5c9e815962
1 /* { dg-do run { target aarch64_sve_hw } } */
2 /* { dg-options "-O2 -ftree-vectorize" } */
4 #include "slp_1.c"
6 #define N (103 * 2)
8 #define HARNESS(TYPE) \
9 { \
10 TYPE a[N], b[2] = { 3, 11 }; \
11 for (unsigned int i = 0; i < N; ++i) \
12 { \
13 a[i] = i * 2 + i % 5; \
14 asm volatile ("" ::: "memory"); \
15 } \
16 vec_slp_##TYPE (a, b[0], b[1], N / 2); \
17 for (unsigned int i = 0; i < N; ++i) \
18 { \
19 TYPE orig = i * 2 + i % 5; \
20 TYPE expected = orig + b[i % 2]; \
21 if (a[i] != expected) \
22 __builtin_abort (); \
23 } \
26 int __attribute__ ((optimize (1)))
27 main (void)
29 TEST_ALL (HARNESS)