gcc/testsuite/gcc.dg/torture/vector-shuffle1.c
raw| 1 | /* PR54219 */ |
| 2 | /* { dg-do run } */ |
| 3 | |
| 4 | extern void abort (void); |
| 5 | |
| 6 | typedef int v2si __attribute__((vector_size(2*sizeof(int)))); |
| 7 | |
| 8 | void f(v2si *x) |
| 9 | { |
| 10 | /* This requires canonicalization of the mask to { 1, 0 }. */ |
| 11 | *x = __builtin_shuffle(*x, *x, (v2si) { 5, 0 }); |
| 12 | } |
| 13 | |
| 14 | int main() |
| 15 | { |
| 16 | v2si y = { 1, 2 }; |
| 17 | f(&y); |
| 18 | if (y[0] != 2 || y[1] != 1) |
| 19 | abort (); |
| 20 | return 0; |
| 21 | } |