Merge from mainline (167278:168000).
[official-gcc/graphite-test-results.git] / gcc / testsuite / gcc.dg / vect / vect-nest-cycle-2.c
blob22b1d98de4b675ec093ddf7f8a961ad661135d4c
1 /* { dg-require-effective-target vect_float } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 16
8 float out[N];
9 float check_res[N] = {880,864,848,832,816,800,784,768,752,736,720,704,688,672,656,640};
10 float a[2*N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31};
12 /* Outer-loop vectorization. */
14 __attribute__ ((noinline)) void
15 foo ()
17 int i, j;
18 float res;
20 for (i = 0; i < N; i++)
22 res = 1000;
24 for (j = 0; j < N; j++)
25 res = res - a[i+j];
27 out[i] = res;
30 for (i = 0; i < N; i++)
31 if (out[i] != check_res[i])
32 abort ();
36 int main ()
38 check_vect ();
40 foo();
42 return 0;
45 /* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail vect_no_align } } } */
46 /* { dg-final { cleanup-tree-dump "vect" } } */