Add support for conditional reductions using SVE CLASTB
[official-gcc.git] / gcc / testsuite / gcc.target / aarch64 / sve / pack_1_run.c
blob1b39b91160d84f50f7cf90fba9edc7404c5fdbf5
1 /* { dg-do run { target aarch64_sve_hw } } */
2 /* { dg-options "-O2 -ftree-vectorize" } */
4 #include "pack_1.c"
6 #define ARRAY_SIZE 57
8 #define TEST_LOOP(TYPED, TYPES) \
9 { \
10 TYPED arrayd[ARRAY_SIZE]; \
11 TYPES arrays[ARRAY_SIZE]; \
12 for (int i = 0; i < ARRAY_SIZE; i++) \
13 { \
14 arrays[i] = (i - 10) * 3; \
15 asm volatile ("" ::: "memory"); \
16 } \
17 pack_##TYPED##_##TYPES (arrayd, arrays, ARRAY_SIZE); \
18 for (int i = 0; i < ARRAY_SIZE; i++) \
19 if (arrayd[i] != (TYPED) ((TYPES) ((i - 10) * 3) + 1)) \
20 __builtin_abort (); \
23 int __attribute__ ((optimize (1)))
24 main (void)
26 TEST_ALL (TEST_LOOP)
27 return 0;