OSDN Git Service

2006-12-11 Diego Novillo <dnovillo@redhat.com>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / vect / vect-ifcvt-9.c
1 /* { dg-require-effective-target vect_condition } */
2
3 #include <stdarg.h>
4 #include <signal.h>
5 #include "tree-vect.h"
6
7 #define N 16
8 #define MAX 42
9
10 extern void abort(void); 
11
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 void foo ()  __attribute__((always_inline));
15 void foo ()
16 {  
17   int i, j;
18
19   for (i = 0; i < 16; i++)
20     A[i] = ( A[i] >= MAX ? MAX : 0); 
21 }
22
23 int main ()
24 {
25
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 ();
33
34   return 0;
35 }
36
37 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" } } */
38 /* { dg-final { cleanup-tree-dump "vect" } } */