[AArch64] SVE tests
[official-gcc.git] / gcc / testsuite / gcc.target / aarch64 / sve / vec_init_1_run.c
blob539ba2c8a23c83468fea534d1b8ec9b98f66ac99
1 /* { dg-do run { target aarch64_sve_hw } } */
2 /* { dg-options "-O2 -ftree-vectorize" } */
4 #include "vec_init_1.c"
6 #define TEST_INIT_VECTOR(TYPE, VAL) \
7 { \
8 TYPE r[NUM_ELEMS (TYPE)]; \
9 dup_##TYPE (r, VAL); \
10 for (int i = 0; i < NUM_ELEMS (TYPE); i++) \
11 if (r[i] != VAL) \
12 __builtin_abort (); \
15 int __attribute__ ((optimize (1)))
16 main (void)
18 TEST_INIT_VECTOR (int8_t, 0x2a);
19 TEST_INIT_VECTOR (int16_t, 0x3976);
20 TEST_INIT_VECTOR (int32_t, 0x31232976);
21 TEST_INIT_VECTOR (int64_t, 0x9489363731232976LL);
23 TEST_INIT_VECTOR (_Float16, -0x1.fp10);
24 TEST_INIT_VECTOR (float, -0x1.fe02p10);
25 TEST_INIT_VECTOR (double, 0x1.fe02eeeee1p10);
27 return 0;