2018-01-16 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / no-trapping-math-2.c
blobd0e4ec2373b66b76235f53522c50ac1067ece4d2
1 /* Test for pr30485. */
2 /* { dg-require-effective-target vect_float } */
4 #include <stdarg.h>
5 #include "tree-vect.h"
7 #define N 16
9 float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
11 __attribute__ ((noinline)) int
12 main1 (void)
14 int i;
15 float a[N];
17 /* Condition in loop. */
18 /* This loop is vectorized on platforms that support vect_condition. */
19 for (i = 0; i < N; i++)
21 a[i] = (b[i] > 0 ? b[i] : 0);
24 for (i = 0; i < N; i++)
26 if (a[i] != b[i])
27 abort ();
29 return 0;
32 int main (void)
34 check_vect ();
35 return main1 ();
38 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_condition } } } */