aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/torture/vector-shuffle1.c
blob: 14e435b8ad76e8780dfcd04f923ad5d37a8be572 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* PR54219 */
/* { dg-do run } */

extern void abort (void);

typedef int v2si __attribute__((vector_size(2*sizeof(int))));

void f(v2si *x)
{
  /* This requires canonicalization of the mask to { 1, 0 }.  */
  *x = __builtin_shuffle(*x, *x, (v2si) { 5, 0 });
}

int main()
{
  v2si y = { 1, 2 };
  f(&y);
  if (y[0] != 2 || y[1] != 1)
    abort ();
  return 0;
}