SVE Intrinsics: Change return type of redirect_call to gcall.
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-reduc-pattern-1b.c
blob96f8b740ced1444436f5069cd647eb0c264113a0
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #if VECTOR_BITS > 128
7 #define N (VECTOR_BITS * 2 / 16)
8 #else
9 #define N 16
10 #endif
12 unsigned char udata_ch[N] =
13 { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28 };
14 #define SUM 210
16 __attribute__ ((noinline)) int
17 foo ()
19 int i;
20 unsigned int intsum = 0;
22 /* widenning sum: sum chars into int. */
23 for (i = 0; i < N; i++)
25 intsum += udata_ch[i];
28 /* check results: */
29 if (intsum != SUM)
30 abort ();
32 return 0;
35 int
36 main (void)
38 check_vect ();
39 return foo ();
42 /* { dg-final { scan-tree-dump "vect_recog_widen_sum_pattern: detected" "vect"} } */
43 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_widen_sum_qi_to_si || vect_unpack } } } } */
44 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" { target { { ! vect_widen_sum_qi_to_si } && { ! vect_unpack } } } } } */