gcc/testsuite/gcc.target/loongarch/pr122695-2.c
raw| 1 | /* { dg-do run } */ |
| 2 | /* { dg-options "-O2 -mlasx" } */ |
| 3 | /* { dg-require-effective-target loongarch_asx_hw } */ |
| 4 | |
| 5 | [[gnu::vector_size(32)]] short a, b, c; |
| 6 | |
| 7 | [[gnu::noipa]] void |
| 8 | test (void) |
| 9 | { |
| 10 | a = __builtin_shuffle(a, b, c) + c; |
| 11 | } |
| 12 | |
| 13 | int |
| 14 | main (void) |
| 15 | { |
| 16 | a = (typeof (a)){} + 1; |
| 17 | b = (typeof (b)){} + 2; |
| 18 | c = (typeof (c)){} + 128; |
| 19 | test (); |
| 20 | if (a[0] != 129) |
| 21 | __builtin_trap (); |
| 22 | } |