summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/pr64688.C
blob: bf85f1abb45a77e22173c78b2a51d4303b693dee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
// { dg-do compile { target i?86-*-* x86_64-*-* } }
// { dg-options "-std=c++11 -O3 -march=westmere" }

template <typename T> struct A { typedef typename T::next type; };
template <typename> struct B;
template <typename T> struct N : T {};
template <int N> struct C {
  static const int value = N;
  typedef C<N + 1> next;
};
template <typename Sequence>
struct R : N<typename B<typename Sequence::tag>::template P<Sequence>> {};
template <typename Base> struct O : Base {
  typedef typename A<typename Base::size>::type size;
};
template <typename = int> struct D {
  typedef int tag;
  typedef C<0> size;
};
template <> struct B<int> {
  template <typename> struct P : O<O<O<D<>>>>::size {};
};
template <typename> struct F;
template <typename> struct G;
template <typename, typename, int> struct H;
template <typename Element, typename Layout> struct H<Element, Layout, 3> {};
template <int, typename E, typename L, int N> unsigned char at_c(H<E, L, N>)
{
  return 0;
}
template <typename> class I;
template <typename> class J;
template <typename> class K;
template <typename, typename> struct Q;
struct L {
  typedef Q<unsigned char, F<O<O<O<D<>>>>>> *type;
};
template <typename XIterator> struct M { typedef K<J<I<XIterator>>> view_t; };
template <typename, typename>
struct Q : H<unsigned, F<int>, R<O<O<O<D<>>>>>::value> {};
template <typename Iterator> struct G<I<Iterator>> { typedef Iterator type; };
template <typename> class J {
public:
  typedef G<I<Q<unsigned, int> *>>::type x_iterator;
};
template <typename> class K {
public:
  J<int>::x_iterator row_begin(int);
};
template <typename Op> void measure_time(Op p1) { p1(); }
template <typename, typename> struct fill_nongil_t;
template <typename T, typename P>
struct fill_nongil_t<K<J<I<Q<T, F<O<O<O<D<>>>>>> *>>>, P> {
  typedef K<J<I<Q<T, F<O<O<O<D<>>>>>> *>>> View;
  View _v;
  P _p;
  fill_nongil_t(View, P);
  void operator()() {
    T *first = (T *)_v.row_begin(0);
    T last;
    while (first != &last) {
      first[0] = first[1] = at_c<1>(_p);
      first[2] = at_c<2>(_p);
      first += 3;
    }
  }
};
template <typename, typename> void test_fill(int) {
  M<L::type>::view_t __trans_tmp_1;
  measure_time(fill_nongil_t<K<J<I<Q<unsigned char, F<O<O<O<D<>>>>>> *>>>,
                             Q<unsigned char, F<O<O<O<D<>>>>>>>(
      __trans_tmp_1, Q<unsigned char, F<O<O<O<D<>>>>>>()));
}
void performance_testtest_method() { test_fill<K<int>, Q<unsigned, int>>(0); }