OSDN Git Service

* testsuite/gcc.dg/altivec-4.c: Test altivec predicates.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / altivec-4.c
1 /* { dg-do compile { target powerpc-*-* } } */
2 /* { dg-options "-maltivec -O0 -Wall" } */
3
4 #define vector __attribute__((vector_size(16)))
5
6 int __attribute__((mode(V4SI))) x, y;
7
8 vector int i,j,k;
9 vector short s,t,u;
10 vector char c,d,e;
11 vector float f,g,h;
12
13 void
14 b()
15 {
16   __builtin_altivec_vadduwm (x, y);
17
18   /* Make sure the predicates accept correct argument types.  */
19   
20   k = __builtin_altivec_vcmpbfp_p (f, g);
21   k = __builtin_altivec_vcmpeqfp_p (f, g);
22   k = __builtin_altivec_vcmpequb_p (c, d);
23   k = __builtin_altivec_vcmpequh_p (s, t);
24   k = __builtin_altivec_vcmpequw_p (i, j);
25   k = __builtin_altivec_vcmpgefp_p (f, g);
26   k = __builtin_altivec_vcmpgtfp_p (f, g);
27   k = __builtin_altivec_vcmpgtsb_p (c, d);
28   k = __builtin_altivec_vcmpgtsh_p (s, t);
29   k = __builtin_altivec_vcmpgtsw_p (i, j);
30   k = __builtin_altivec_vcmpgtub_p (c, d);
31   k = __builtin_altivec_vcmpgtuh_p (s, t);
32   k = __builtin_altivec_vcmpgtuw_p (i, j);
33 }