LWG 3035. std::allocator's constructors should be constexpr
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-cond-6.c
blob65fdc4a9ef195f7210b08289242e74cda1db4831
1 /* { dg-require-effective-target vect_condition } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define K 32
8 int cond_array[2*K][K] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
9 int a[K][K] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
10 int out[K];
12 __attribute__ ((noinline)) void
13 foo (int c)
15 int res, i, j, k, next;
17 for (k = 0; k < K; k++)
19 for (j = 0; j < K; j++)
21 res = 0;
22 for (i = 0; i < K; i++)
24 next = a[i][j];
25 res = c > cond_array[i+k][j] ? next : res;
28 out[j] = res;
33 int main ()
35 int i, j, k;
37 check_vect ();
39 for (j = 0; j < K; j++)
41 for (i = 0; i < 2*K; i++)
42 cond_array[i][j] = i+j;
44 for (i = 0; i < K; i++)
45 a[i][j] = i+2;
48 foo(125);
50 for (k = 0; k < K; k++)
51 if (out[k] != 33)
52 abort ();
54 return 0;
57 /* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" } } */