2018-01-16 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-ifcvt-9.c
blobe6446a765c0298857f71b80ffcaefdf77e4f5ce3
1 /* { dg-require-effective-target vect_condition } */
2 /* { dg-require-effective-target vect_int } */
4 #include <stdarg.h>
5 #include "tree-vect.h"
7 #define N 16
8 #define MAX 42
10 extern void abort(void);
12 int A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11};
13 int B[N] = {0,0,42,42,42,0,0,0,0,0,42,42,42,42,42,0};
14 inline void foo () __attribute__((always_inline));
15 void foo ()
17 int i, j;
19 for (i = 0; i < 16; i++)
20 A[i] = ( A[i] >= MAX ? MAX : 0);
23 int main ()
26 int i, j;
27 check_vect ();
28 foo ();
29 /* check results: */
30 for (i = 0; i < N; i++)
31 if (A[i] != B[i])
32 abort ();
34 return 0;
37 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" } } */