diff options
Diffstat (limited to 'gcc/testsuite/c-c++-common/builtin-shuffle-1.c')
-rw-r--r-- | gcc/testsuite/c-c++-common/builtin-shuffle-1.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/c-c++-common/builtin-shuffle-1.c b/gcc/testsuite/c-c++-common/builtin-shuffle-1.c new file mode 100644 index 00000000000..30fd69082dd --- /dev/null +++ b/gcc/testsuite/c-c++-common/builtin-shuffle-1.c @@ -0,0 +1,22 @@ +/* PR c++/78089 */ +/* { dg-do run } */ + +typedef int V __attribute__((vector_size (16))); +V a, b, c; + +int +foo () +{ + return __builtin_shuffle (a, b, c)[3]; +} + +int +main () +{ + a = (V) { 1, 2, 3, 4 }; + b = (V) { 5, 6, 7, 8 }; + c = (V) { 7, 2, 5, 6 }; + if (foo () != 7) + __builtin_abort (); + return 0; +} |