1 /* { dg-do compile } */
2 /* { dg-options "-O2 -ftree-vectorize -msve-vector-bits=512" } */
3 
4 #include <stdint.h>
5 
6 #define ADD_LOOP(TYPE, COUNT)			\
7   TYPE __attribute__ ((noinline, noclone))	\
8   vec_while_##TYPE (TYPE *restrict a)		\
9   {						\
10     for (int i = 0; i < COUNT; ++i)	       	\
11       a[i] += 1;				\
12   }
13 
14 #define TEST_ALL(T)				\
15   T (int8_t, 63)				\
16   T (int16_t, 30)				\
17   T (int32_t, 15)				\
18   T (int64_t, 6)
19 
20 TEST_ALL (ADD_LOOP)
21 
22 /* { dg-final { scan-assembler-times {\tptrue\tp[0-7]\.b, mul3\n} 1 } } */
23 /* { dg-final { scan-assembler-times {\tptrue\tp[0-7]\.h, mul3\n} 1 } } */
24 /* { dg-final { scan-assembler-times {\tptrue\tp[0-7]\.s, mul3\n} 1 } } */
25 /* { dg-final { scan-assembler-times {\tptrue\tp[0-7]\.d, vl6\n} 1 } } */
26