summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/conversion/simd4.C
blob: f8f7f2e4501d5d68182426b60b71630b84b56f78 (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
// PR c++/29734
// { dg-do compile }
// { dg-options "" }

int t;
float u;
int __attribute__((vector_size (8))) v;
float __attribute__((vector_size (8))) w;
int b[10];

void
foo ()
{
  b[t];
  b[u];		// { dg-error "invalid types" }
  b[v];		// { dg-error "invalid types" }
  b[w];		// { dg-error "invalid types" }
  t[b];
  u[b];		// { dg-error "invalid types" }
  v[b];		// { dg-error "invalid types" }
  w[b];		// { dg-error "invalid types" }
  new int[t];
  new int[u];	// { dg-error "new-declarator must have integral" }
  new int[v];	// { dg-error "new-declarator must have integral" }
  new int[w];	// { dg-error "new-declarator must have integral" }
  switch (t) { default: break; }
  switch (u) { default: break; }	// { dg-error "switch quantity not an integer" }
  switch (v) { default: break; }	// { dg-error "switch quantity not an integer" }
  switch (w) { default: break; }	// { dg-error "switch quantity not an integer" }
  t = ~t;
  u = ~u;	// { dg-error "wrong type argument to bit-complement" }
  v = ~v;
  w = ~w;	// { dg-error "wrong type argument to bit-complement" }
}