Fortran: Fix PR 47485.
[gcc.git] / gcc / testsuite / g++.dg / cpp0x / pr70887.C
blob38b0fb2f9b2e49030c7ae3365f8d01cf2b73236a
1 // PR middle-end/70887
2 // { dg-do compile { target { { i?86-*-* x86_64-*-* } && c++11 } } }
3 // { dg-options "-O2 -msse2" }
4 // { dg-skip-if "requires hosted libstdc++ for cstdlib malloc" { ! hostedlib } }
6 #include <x86intrin.h>
8 enum R { S };
9 template <R> struct C { static constexpr int value = 10; };
10 template <typename R, template <R> class T, R... r>
11 struct A {
12   template <int, R...> struct B;
13   template <int N, R M, R... O>
14   struct B<N, M, O...> {
15     static constexpr int d = T<M>::value;
16     static __m128i generate()
17     {
18       __attribute__((__vector_size__(16))) long long
19       a = generate(),
20       b = _mm_bslli_si128 (a, 1),
21       c = _mm_bsrli_si128 (_mm_set1_epi32(d), 12);
22       return _mm_or_si128 (b, c);
23     }
24   };
25   A () { B<0, r...>::generate(); }
28 int
29 main () {
30   using RI = A<R, C, S>;
31   RI ri;