Merged with mainline at revision 128810.
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / no-scevccp-outer-14.c
blobd7614dc9df8fb7fe55f48802deadcb1507b880f7
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 64
8 __attribute__ ((noinline)) unsigned short
9 foo (short scale){
10 int i;
11 unsigned short j;
12 unsigned short sum = 0;
13 unsigned short sum_j;
15 for (i = 0; i < N; i++) {
16 sum_j = 0;
17 for (j = 0; j < N; j++) {
18 sum_j += j;
20 sum += sum_j;
22 return sum;
25 __attribute__ ((noinline)) unsigned short
26 bar (void)
28 unsigned short j;
29 unsigned short sum_j;
30 sum_j = 0;
31 for (j = 0; j < N; j++) {
32 sum_j += j;
34 return sum_j;
37 int main (void)
39 int i;
40 unsigned short j, sum_j;
41 unsigned short sum = 0;
42 unsigned short res;
44 check_vect ();
46 res = foo (2);
48 /* check results: */
49 for (i=0; i<N; i++)
51 sum_j = bar();
52 sum += sum_j;
54 if (res != sum)
55 abort ();
57 return 0;
60 /* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { target vect_widen_mult_hi_to_si } } } */
61 /* { dg-final { cleanup-tree-dump "vect" } } */