OSDN Git Service

2007-12-06 Zdenek Dvorak <ook@ucw.cz>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / vect / no-trapping-math-2.c
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 __attribute__ ((noinline)) int
10 main1 (void)
11 {
12   int i;
13   float a[N];
14   float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
15
16   /* Condition in loop.  */
17   /* This loop is vectorized on platforms that support vect_condition.  */
18   for (i = 0; i < N; i++)
19   {
20     a[i] = (b[i] > 0 ? b[i] : 0);
21   }
22
23   for (i = 0; i < N; i++)
24   {
25     if (a[i] != b[i])
26         abort ();
27   }
28   return 0;
29 }
30
31 int main (void)
32 {
33   check_vect ();
34   return main1 ();
35 }
36
37 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_condition } } } */
38 /* { dg-final { cleanup-tree-dump "vect" } } */