aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/ext/builtin-shufflevector-1.C
blob: 386953153dcc58a56984d56a9bf0f24b0719aea3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// { dg-do compile { target c++11 } }
// { dg-options "-Wno-psabi -w" }

template <typename T1, typename T2, int ...args>
struct shufflevector
{
  static auto shuffle (T1 a, T2 b)
      -> decltype (__builtin_shufflevector (a, b, args...))
  {
    return __builtin_shufflevector (a, b, args...);
  }
};

typedef int v4si __attribute__((vector_size (16)));
v4si a, b, c;
int main()
{
  c = shufflevector<v4si, v4si, 0, 1, 4, 5>::shuffle (a, b);
}