summaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/builtin-shufflevector-2.c
blob: 78cec1684fc387922d719d0c9da47bd4d791e584 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/* { dg-do compile } */

typedef long v4di __attribute__((vector_size(4 * sizeof (long))));
typedef int v4si __attribute__((vector_size(4 * sizeof (int))));
typedef int v8si __attribute__((vector_size(8 * sizeof (int))));

v4si res, a, b;
v4di resl, al, bl;
v8si res8, a8, b8;
void foo (void)
{
  res = __builtin_shufflevector (a, 0, 0, 1, 4, 5); /* { dg-error "must be vectors" } */
  res = __builtin_shufflevector (a, b, 0, 1, 4, 5, 6); /* { dg-error "power of two" } */
  res = __builtin_shufflevector (a, b, 0, 1, 4, 8); /* { dg-error "invalid" } */
  res = __builtin_shufflevector (a, b, 0, 1, -4, 5); /* { dg-error "invalid" } */
  res = __builtin_shufflevector (a, bl, 0, 1, 4, 5); /* { dg-error "same element type" } */
  resl = __builtin_shufflevector (a, b, 0, 1, 4, 5); /* { dg-error "" } incompatible types */
}