openmp: Add testcases for omp_max_vf
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / no-scevccp-noreassoc-outer-3.c
blob494ff0b6f8f14f3d3b6aba1ada60d6442ce10811
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,j;
13 int sum,x;
15 for (i = 0; i < N; i++) {
16 sum = 0;
17 for (j = 0; j < N; j++) {
18 sum += (i + j);
20 a[i] = sum;
24 int main (void)
26 int i,j;
27 int sum;
29 check_vect ();
31 foo ();
33 /* check results: */
34 #pragma GCC novector
35 for (i=0; i<N; i++)
37 sum = 0;
38 for (j = 0; j < N; j++){
39 sum += (j + i);
41 if (a[i] != sum)
42 abort();
45 return 0;
48 /* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" } } */