Merge from mainline (167278:168000).
[official-gcc/graphite-test-results.git] / gcc / testsuite / gcc.dg / vect / no-scevccp-outer-16.c
blobea58d395c3dc4c2b8715dcd35d9afde71badb486
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 40
8 int a[N];
10 __attribute__ ((noinline)) int
11 foo (){
12 int i;
13 unsigned short j;
14 int sum = 0;
15 unsigned short sum_j;
17 for (i = 0; i < N; i++) {
18 sum += i;
20 sum_j = 0;
21 for (j = 0; j < N; j++) {
22 sum_j += j;
24 a[i] = sum_j + 5;
26 return sum;
29 int main (void)
31 int i;
32 unsigned short j, sum_j;
33 int sum = 0;
34 int res;
36 check_vect ();
38 for (i=0; i<N; i++)
39 a[i] = i;
41 res = foo ();
43 /* check results: */
44 for (i=0; i<N; i++)
46 sum += i;
48 sum_j = 0;
49 for (j = 0; j < N; j++){
50 sum_j += j;
52 if (a[i] != sum_j + 5)
53 abort();
55 if (res != sum)
56 abort ();
58 return 0;
61 /* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { xfail { ! {vect_unpack } } } } } */
62 /* { dg-final { cleanup-tree-dump "vect" } } */