Debian Codegraph @

gcc/testsuite/g++.dg/cpp0x/pr70887.C

raw
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 } }
5
6 #include <x86intrin.h>
7
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(); }
26 };
27
28 int
29 main () {
30 using RI = A<R, C, S>;
31 RI ri;
32 }