gcc/testsuite/c-c++-common/builtin-shuffle-1.c
raw| 1 | /* PR c++/78089 */ |
| 2 | /* { dg-do run } */ |
| 3 | /* { dg-additional-options "-fno-common" { target hppa*-*-hpux* } } */ |
| 4 | |
| 5 | typedef int V __attribute__((vector_size (4 * __SIZEOF_INT__))); |
| 6 | V a, b, c; |
| 7 | |
| 8 | int |
| 9 | foo () |
| 10 | { |
| 11 | return __builtin_shuffle (a, b, c)[3]; |
| 12 | } |
| 13 | |
| 14 | int |
| 15 | main () |
| 16 | { |
| 17 | a = (V) { 1, 2, 3, 4 }; |
| 18 | b = (V) { 5, 6, 7, 8 }; |
| 19 | c = (V) { 7, 2, 5, 6 }; |
| 20 | if (foo () != 7) |
| 21 | __builtin_abort (); |
| 22 | return 0; |
| 23 | } |