[AArch64] Fix SVE testsuite failures for ILP32 (PR 83846)
[official-gcc.git] / gcc / testsuite / gcc.target / aarch64 / sve / slp_3_run.c
blob0ec1cea1be0c850154f54f483fc95e16a4a416f8
1 /* { dg-do run { target aarch64_sve_hw } } */
2 /* { dg-options "-O2 -ftree-vectorize" } */
4 #include "slp_3.c"
6 #define N (77 * 4)
8 #define HARNESS(TYPE) \
9 { \
10 TYPE a[N], b[4] = { 41, 25, 31, 62 }; \
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, N / 4); \
17 for (unsigned int i = 0; i < N; ++i) \
18 { \
19 TYPE orig = i * 2 + i % 5; \
20 TYPE expected = orig + b[i % 4]; \
21 if (a[i] != expected) \
22 __builtin_abort (); \
23 } \
26 int __attribute__ ((optimize (1)))
27 main (void)
29 TEST_ALL (HARNESS)