comparison gcc/testsuite/gcc.dg/vect/no-trapping-math-2.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
comparison
equal deleted inserted replaced
68:561a7518be6b 111:04ced10e8804
1 /* Test for pr30485. */
2 /* { dg-require-effective-target vect_float } */
3
4 #include <stdarg.h>
5 #include "tree-vect.h"
6
7 #define N 16
8
9 float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
10
11 __attribute__ ((noinline)) int
12 main1 (void)
13 {
14 int i;
15 float a[N];
16
17 /* Condition in loop. */
18 /* This loop is vectorized on platforms that support vect_condition. */
19 for (i = 0; i < N; i++)
20 {
21 a[i] = (b[i] > 0 ? b[i] : 0);
22 }
23
24 for (i = 0; i < N; i++)
25 {
26 if (a[i] != b[i])
27 abort ();
28 }
29 return 0;
30 }
31
32 int main (void)
33 {
34 check_vect ();
35 return main1 ();
36 }
37
38 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_condition } } } */