1 // { dg-do compile { target i?86-*-* x86_64-*-* } }
2 // { dg-options "-std=c++11 -O3 -march=westmere" }
4 template <typename T> struct A { typedef typename T::next type; };
5 template <typename> struct B;
6 template <typename T> struct N : T {};
7 template <int N> struct C {
8 static const int value = N;
11 template <typename Sequence>
12 struct R : N<typename B<typename Sequence::tag>::template P<Sequence>> {};
13 template <typename Base> struct O : Base {
14 typedef typename A<typename Base::size>::type size;
16 template <typename = int> struct D {
20 template <> struct B<int> {
21 template <typename> struct P : O<O<O<D<>>>>::size {};
23 template <typename> struct F;
24 template <typename> struct G;
25 template <typename, typename, int> struct H;
26 template <typename Element, typename Layout> struct H<Element, Layout, 3> {};
27 template <int, typename E, typename L, int N> unsigned char at_c(H<E, L, N>)
31 template <typename> class I;
32 template <typename> class J;
33 template <typename> class K;
34 template <typename, typename> struct Q;
36 typedef Q<unsigned char, F<O<O<O<D<>>>>>> *type;
38 template <typename XIterator> struct M { typedef K<J<I<XIterator>>> view_t; };
39 template <typename, typename>
40 struct Q : H<unsigned, F<int>, R<O<O<O<D<>>>>>::value> {};
41 template <typename Iterator> struct G<I<Iterator>> { typedef Iterator type; };
42 template <typename> class J {
44 typedef G<I<Q<unsigned, int> *>>::type x_iterator;
46 template <typename> class K {
48 J<int>::x_iterator row_begin(int);
50 template <typename Op> void measure_time(Op p1) { p1(); }
51 template <typename, typename> struct fill_nongil_t;
52 template <typename T, typename P>
53 struct fill_nongil_t<K<J<I<Q<T, F<O<O<O<D<>>>>>> *>>>, P> {
54 typedef K<J<I<Q<T, F<O<O<O<D<>>>>>> *>>> View;
57 fill_nongil_t(View, P);
59 T *first = (T *)_v.row_begin(0);
61 while (first != &last) {
62 first[0] = first[1] = at_c<1>(_p);
63 first[2] = at_c<2>(_p);
68 template <typename, typename> void test_fill(int) {
69 M<L::type>::view_t __trans_tmp_1;
70 measure_time(fill_nongil_t<K<J<I<Q<unsigned char, F<O<O<O<D<>>>>>> *>>>,
71 Q<unsigned char, F<O<O<O<D<>>>>>>>(
72 __trans_tmp_1, Q<unsigned char, F<O<O<O<D<>>>>>>()));
74 void performance_testtest_method() { test_fill<K<int>, Q<unsigned, int>>(0); }