Use conditional internal functions in if-conversion
[official-gcc.git] / gcc / testsuite / gcc.target / aarch64 / sve / mask_struct_load_1_run.c
blob7df791f04fe09360cd75f9a05b52e8c243e2663e
1 /* { dg-do run { target aarch64_sve_hw } } */
2 /* { dg-options "-O2 -ftree-vectorize -ffast-math" } */
4 #include "mask_struct_load_1.c"
6 #define N 100
8 #undef TEST_LOOP
9 #define TEST_LOOP(NAME, OUTTYPE, INTYPE, MASKTYPE) \
10 { \
11 OUTTYPE out[N]; \
12 INTYPE in[N * 2]; \
13 MASKTYPE mask[N]; \
14 for (int i = 0; i < N; ++i) \
15 { \
16 out[i] = i * 7 / 2; \
17 mask[i] = i % 5 <= i % 3; \
18 asm volatile ("" ::: "memory"); \
19 } \
20 for (int i = 0; i < N * 2; ++i) \
21 in[i] = i * 9 / 2; \
22 NAME##_2 (out, in, mask, N); \
23 for (int i = 0; i < N; ++i) \
24 { \
25 OUTTYPE if_true = in[i * 2] + in[i * 2 + 1]; \
26 OUTTYPE if_false = i * 7 / 2; \
27 if (out[i] != (mask[i] ? if_true : if_false)) \
28 __builtin_abort (); \
29 asm volatile ("" ::: "memory"); \
30 } \
33 int __attribute__ ((optimize (1)))
34 main (void)
36 TEST (test);
37 return 0;