[AArch64] Fix SVE testsuite failures for ILP32 (PR 83846)
[official-gcc.git] / gcc / testsuite / gcc.target / aarch64 / sve / struct_vect_20_run.c
blob978f02bbc13618cadcb5791bbb0e1099bba80947
1 /* { dg-do run { target aarch64_sve_hw } } */
2 /* { dg-options "-O2 -ftree-vectorize" } */
4 #include "struct_vect_20.c"
6 #undef TEST_LOOP
7 #define TEST_LOOP(NAME, TYPE) \
8 { \
9 TYPE out[N]; \
10 TYPE in[N * 2]; \
11 for (int i = 0; i < N; ++i) \
12 { \
13 out[i] = i * 7 / 2; \
14 asm volatile ("" ::: "memory"); \
15 } \
16 for (int i = 0; i < N * 2; ++i) \
17 { \
18 in[i] = i * 9 / 2; \
19 asm volatile ("" ::: "memory"); \
20 } \
21 NAME (out, in); \
22 for (int i = 0; i < N; ++i) \
23 { \
24 TYPE expected = i * 7 / 2 + in[i * 2]; \
25 if (out[i] != expected) \
26 __builtin_abort (); \
27 asm volatile ("" ::: "memory"); \
28 } \
31 int __attribute__ ((optimize (1)))
32 main (void)
34 TEST (test);
35 return 0;