1 /* { dg-do compile } */
2 /* { dg-options "-Wall" } */
3 
4 /* Origin: Aldy Hernandez <aldyh@redhat.com>.  */
5 /* Purpose: Program to test generic SIMD support.  */
6 
7 typedef int __attribute__((vector_size (16))) v4si;
8 typedef int __attribute__((vector_size (8))) v2si;
9 
10 v4si a, b;
11 v2si c, d;
12 
13 void
hanneke()14 hanneke ()
15 {
16   /* Operators on compatible SIMD types.  */
17   a %= b;
18   c &= d;
19   a |= b;
20   c ^= d;
21   a >>= b;
22   c <<= d;
23   a = +b;
24   c = ~d;
25 
26   /* Operators on incompatible SIMD types.  */
27   a = b % c; /* { dg-error "invalid operands to binary" } */
28   a = b % c; /* { dg-error "invalid operands to binary" } */
29   d = c & b; /* { dg-error "invalid operands to binary" } */
30   a = b | c; /* { dg-error "invalid operands to binary" } */
31   d = c ^ b; /* { dg-error "invalid operands to binary" } */
32   a = b >> c; /*  { dg-error "invalid operands to binary" } */
33   a = b >> c; /* { dg-error "invalid operands to binary" } */
34   d = c << b; /* { dg-error "invalid operands to binary" } */
35   d = c << b; /* { dg-error "invalid operands to binary" } */
36 }
37