LWG 3035. std::allocator's constructors should be constexpr
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-nest-cycle-3.c
blobf2ab30c63b2e28fbd453af68628d3491d6b4d034
1 /* { dg-require-effective-target vect_float } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 16
7 #define DIFF 82
9 float c[N][N], b[N][N], a[N];
11 __attribute__ ((noinline)) int
12 main1 ()
14 int i, j;
15 float diff;
17 /* In inner loop vectorization -funsafe-math-optimizations is needed to
18 vectorize the summation. But in outer loop vectorization the order of
19 calculation doesn't change, therefore, there is no need in that flag. */
20 for (i = 0; i < N; i++)
22 diff = 2;
23 for (j = 0; j < N; j++)
24 diff += (b[j][i] - c[j][i]);
26 a[i] = diff;
29 /* Check results: */
30 for (i = 0; i < N; i++)
31 if (a[i] != DIFF)
32 abort ();
34 return 0;
37 int main (void)
39 int i, j;
41 check_vect ();
43 for (i = 0; i < N; i++)
44 for (j = 0; j < N; j++)
46 b[i][j] = i+j+5;
47 c[i][j] = i+j;
50 main1 ();
52 return 0;
55 /* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" } } */