* Mainline merge as of 2006-02-16 (@111136).
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / wrapv-vect-reduc-pattern-2c.c
blob9296098d73f84af33592d9b73e5498a4f17ee240
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 16
7 signed char data_ch[N] =
8 { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28 };
9 #define SUM 210
11 int
12 foo ()
14 int i;
15 signed short shortsum = 0;
17 /* widenning sum: sum chars into short. */
19 for (i = 0; i < N; i++)
21 shortsum += data_ch[i];
24 /* check results: */
25 if (shortsum != SUM)
26 abort ();
28 return 0;
31 int
32 main (void)
34 check_vect ();
35 return foo ();
38 /* { dg-final { scan-tree-dump-times "vect_recog_widen_sum_pattern: detected" 1 "vect" } } */
39 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_widen_sum_qi_to_hi } } } */
40 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" { target { ! vect_widen_sum_qi_to_hi } } } } */
41 /* { dg-final { cleanup-tree-dump "vect" } } */