OSDN Git Service

PR tree-optimization/40542
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / vect / vect-ifcvt-9.c
1 /* { dg-require-effective-target vect_condition } */
2 /* { dg-require-effective-target vect_int } */
3
4 #include <stdarg.h>
5 #include <signal.h>
6 #include "tree-vect.h"
7
8 #define N 16
9 #define MAX 42
10
11 extern void abort(void); 
12
13 int A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11};
14 int B[N] = {0,0,42,42,42,0,0,0,0,0,42,42,42,42,42,0};
15 inline void foo ()  __attribute__((always_inline));
16 void foo ()
17 {  
18   int i, j;
19
20   for (i = 0; i < 16; i++)
21     A[i] = ( A[i] >= MAX ? MAX : 0); 
22 }
23
24 int main ()
25 {
26
27   int i, j;
28   check_vect ();
29   foo ();
30   /* check results:  */
31   for (i = 0; i < N; i++)
32     if (A[i] != B[i])
33       abort ();
34
35   return 0;
36 }
37
38 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" } } */
39 /* { dg-final { cleanup-tree-dump "vect" } } */