OSDN Git Service

2011-10-18 Janus Weil <janus@gcc.gnu.org>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / vector-compare-1.c
1 /* { dg-do compile } */
2 #define vector(elcount, type)  \
3 __attribute__((vector_size((elcount)*sizeof(type)))) type
4
5 void
6 foo (vector (4, int) x, vector (4, float) y)
7 {
8   vector (4, int) p4;
9   vector (4, int) r4;
10   vector (4, unsigned int) q4;
11   vector (8, int) r8;
12   vector (4, float) f4;
13   
14   r4 = x > y;       /* { dg-error "comparing vectors with different element types" } */
15   r8 = (x != p4);   /* { dg-error "incompatible types when assigning to type" } */
16   r8 == r4;         /* { dg-error "comparing vectors with different number of elements" } */
17 }