gcc/testsuite/g++.dg/ext/builtin-shufflevector-1.C
raw| 1 | // { dg-do compile { target c++11 } } |
| 2 | // { dg-options "-Wno-psabi -w" } |
| 3 | |
| 4 | template <typename T1, typename T2, int ...args> |
| 5 | struct shufflevector |
| 6 | { |
| 7 | static auto shuffle (T1 a, T2 b) |
| 8 | -> decltype (__builtin_shufflevector (a, b, args...)) |
| 9 | { |
| 10 | return __builtin_shufflevector (a, b, args...); |
| 11 | } |
| 12 | }; |
| 13 | |
| 14 | typedef int v4si __attribute__((vector_size (16))); |
| 15 | v4si a, b, c; |
| 16 | int main() |
| 17 | { |
| 18 | c = shufflevector<v4si, v4si, 0, 1, 4, 5>::shuffle (a, b); |
| 19 | } |