1 /* { dg-do run { target aarch64_sve_hw } } */
2 /* { dg-options "-O2 -ftree-vectorize" } */
3 
4 #include "slp_13.c"
5 
6 #define N1 (103 * 2)
7 #define N2 (111 * 2)
8 
9 #define HARNESS(TYPE)						\
10   {								\
11     TYPE a[N2];							\
12     TYPE expected = 0;						\
13     for (unsigned int i = 0; i < N2; ++i)			\
14       {								\
15 	a[i] = i * 2 + i % 5;					\
16 	if (i < N1)						\
17 	  expected += a[i] * (i & 1 ? 5 : 3);			\
18 	asm volatile ("");					\
19       }								\
20     if (vec_slp_##TYPE (a, N1 / 2) != expected)			\
21       __builtin_abort ();					\
22   }
23 
24 int __attribute__ ((optimize (1)))
main(void)25 main (void)
26 {
27   TEST_ALL (HARNESS)
28 }
29