summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/simd-1b.c
blob: 44c39c2ef96f3c920ab30d80ba32f7ef13f4926b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/* { dg-do compile } */
/* { dg-options "-Wall" } */

/* Origin: Aldy Hernandez <aldyh@redhat.com>.  */
/* Purpose: Program to test generic SIMD support.  */

typedef int __attribute__((vector_size (16))) v4si;
typedef int __attribute__((vector_size (8))) v2si;

v4si a, b;
v2si c, d;

void
hanneke ()
{
  /* Operators on compatible SIMD types.  */
  a %= b;
  c &= d;
  a |= b;
  c ^= d;
  a >>= b;
  c <<= d;
  a = +b;
  c = ~d;

  /* Operators on incompatible SIMD types.  */
  a = b % c; /* { dg-error "invalid operands to binary" } */
  a = b % c; /* { dg-error "invalid operands to binary" } */
  d = c & b; /* { dg-error "invalid operands to binary" } */
  a = b | c; /* { dg-error "invalid operands to binary" } */
  d = c ^ b; /* { dg-error "invalid operands to binary" } */
  a = b >> c; /*  { dg-error "invalid operands to binary" } */
  a = b >> c; /* { dg-error "invalid operands to binary" } */
  d = c << b; /* { dg-error "invalid operands to binary" } */
  d = c << b; /* { dg-error "invalid operands to binary" } */
}