2009-07-17 Richard Guenther <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / no-scevccp-outer-6-global.c
bloba87367b3b08690a59ff6d1116339d7fad27a1aa6
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 (int * __restrict__ b, int k){
12 int i,j;
13 int sum,x;
15 for (i = 0; i < N; i++) {
16 sum = b[i];
17 for (j = 0; j < N; j++) {
18 sum += j;
20 a[i] = sum;
23 return a[k];
26 int main (void)
28 int i,j;
29 int sum;
30 int b[N];
31 int a[N];
33 check_vect ();
35 for (i=0; i<N; i++)
36 b[i] = i + 2;
38 for (i=0; i<N; i++)
39 a[i] = foo (b,i);
41 /* check results: */
42 for (i=0; i<N; i++)
44 sum = b[i];
45 for (j = 0; j < N; j++){
46 sum += j;
48 if (a[i] != sum)
49 abort();
52 return 0;
55 /* "Too many BBs in loop" */
56 /* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { xfail *-*-* } } } */
57 /* { dg-final { scan-tree-dump-times "vect_recog_widen_mult_pattern: detected" 1 "vect" { xfail *-*-* } } } */
58 /* { dg-final { cleanup-tree-dump "vect" } } */