1 // PR target/85503 2 // { dg-do compile { target { { powerpc64le-*-* } && c++11 } } } 3 // { dg-require-effective-target powerpc_vsx_ok } 4 // { dg-options "-O2 -mvsx" } 5 6 namespace b { 7 template < int c > struct d { static constexpr int e = c; }; 8 typedef d< false > f; 9 template < typename g > struct h { typedef g i; }; 10 template < typename > class j; 11 template < bool, bool, typename... > struct aa; 12 struct k { 13 template < typename n, typename... q > 14 static h< decltype(n()(q()...)) > o(int); 15 }; 16 template < typename p, typename... t > struct aa< false, false, p, t... > : k { 17 typedef decltype(o< p, t... >(0)) i; 18 }; 19 template < typename p, typename... t > 20 struct ab : aa< f::e, f::e, p, t... >::i {}; 21 template < typename p, typename... t > struct j< p(t...) > : ab< p, t... > {}; 22 } enum { r, s }; 23 typedef long x; 24 template < typename > struct ac; 25 template < typename y > struct ac< y & > { typedef y i; }; 26 template < typename y > struct j { typedef typename b::j< y >::i i; }; 27 template < typename > struct ad; 28 template < typename > struct ae; 29 template < typename > class af; 30 template < typename, int ag, int ah, int = 0, int = ag, int = ah > class ai; 31 template < typename > class aj; 32 template < typename, typename, typename > class ak; 33 template < typename > class al; 34 template < typename > struct am; 35 template < typename > struct an; 36 template < typename y > struct ao { typedef typename am< y >::i i; }; 37 struct aq { 38 typedef const ai< double, 2, 1 > &ar; 39 }; 40 template < typename as > struct at { typedef aj< as > i; }; 41 template < typename as > struct au { typedef typename at< as >::i i; }; 42 template < typename av > av aw(const typename an< av >::i *); 43 template < typename av, int > av az(const typename an< av >::i *ba) { 44 return aw< av >(ba); 45 } 46 typedef __attribute__((altivec(vector__))) double bb; 47 template <> struct am< double > { typedef bb i; }; 48 template <> struct an< bb > { typedef double i; }; 49 template <> bb aw(const double *ba) { return __builtin_vec_vsx_ld(0, ba); } 50 struct bc { 51 template < typename av > int bd(av a) { bd(a); __builtin_unreachable (); } 52 }; 53 struct be { 54 double operator()(const int, const int); 55 }; 56 template < typename as > class bf : public ae< as > { 57 public: 58 typedef typename ad< as >::bg bg; 59 using ae< as >::bh; 60 enum { bi }; 61 bg bj() const; 62 template < typename bk > bg bl(const bk &) const; 63 }; 64 template < typename as > class aj : public bf< as > { 65 public: 66 using bf< as >::bh; 67 template < typename bm > ak< be, const as, const bm > operator-(bm bn) { 68 return ak< be, const as, const bm >(bh(), bn); 69 } 70 int bo() const; 71 al< as > array() { return bh(); } 72 }; 73 template < typename as > struct ae { 74 const as &bh() const { return *static_cast< const as * >(this); } 75 }; 76 template < typename > struct bp; 77 template < typename > struct bq; 78 template < typename y > struct br : bq< y > { 79 br(y bs) : bq< y >(bs) {} 80 }; 81 template < typename y > struct br< const y > : br< y > { 82 br(const y &bs) : br< y >(bs) {} 83 }; 84 template < typename as > struct br< af< as > > { 85 typedef as bt; 86 br(const bt &m) : bu(m.bv()) {} 87 template < int bw, typename ay > ay bx(x, x by) { 88 return az< ay, bw >(bu + by); 89 } 90 const typename bt::bg *bu; 91 }; 92 template < typename bg, int u, int bz, int ca, int cb, int cc > 93 struct br< ai< bg, u, bz, ca, cb, cc > > : br< af< ai< bg, u, bz > > > { 94 typedef ai< bg, u, bz > cd; 95 br(const cd &m) : br< af< cd > >(m) {} 96 }; 97 template < typename bk, typename ce, typename cf > 98 struct br< ak< bk, ce, cf > > : bp< ak< bk, ce, cf > > { 99 br(ak< bk, ce, cf > bs) : bp< ak< bk, ce, cf > >(bs) {} 100 }; 101 template < typename bk, typename ce, typename cf > 102 struct bp< ak< bk, ce, cf > > { 103 bp(ak< bk, ce, cf > bs) : cg(), ch(bs.ci()) {} 104 template < int bw, typename ay > ay bx(x cj, x by) { 105 return ch.template bx< bw, ay >(cj, by); 106 } 107 ce cg; 108 br< cf > ch; 109 }; 110 template < typename cd > struct v { 111 typedef typename ac< typename cd::ck >::i cl; 112 v(cl &arg) : cn(arg) {} 113 template < int bw, typename ay > ay bx(x cj, x by) { 114 return cn.template bx< bw, ay >(cj, by); 115 } 116 br< cl > cn; 117 }; 118 template < typename cm > struct bq< al< cm > > : v< al< cm > > { 119 bq(al< cm > w) : v< al< cm > >(w.dd()) {} 120 }; 121 template < typename as > class ap : public bf< as > {}; 122 template < int ax > struct co { double array[ax]; }; 123 template < int ax > class cq { 124 co< ax > bu; 125 126 public: 127 const double *bv() const { return bu.array; } 128 }; 129 template < typename as > class af : public at< as >::i { 130 public: 131 typedef typename at< as >::i cp; 132 cq< cp::bi > cs; 133 const typename ad< as >::bg *bv() const { return cs.bv(); } 134 }; 135 template < typename cr, int ag, int ah, int cu, int ct, int cw > 136 struct ad< ai< cr, ag, ah, cu, ct, cw > > { 137 typedef cr bg; 138 }; 139 template < typename, int ag, int ah, int, int, int > 140 class ai : public af< ai< double, ag, ah > > { 141 typedef ai cv; 142 }; 143 template < typename bk, typename ce, typename cf > 144 struct ad< ak< bk, ce, cf > > { 145 typedef typename j< bk(typename ce::bg, typename cf::bg) >::i bg; 146 }; 147 template < typename, typename, typename > class z; 148 template < typename bk, typename cy, typename cx > 149 class ak : public z< bk, cy, cx > { 150 public: 151 typedef cx RhsNested; 152 ak(cy, cx cz) : da(), db(cz) {} 153 RhsNested ci() { return db; } 154 cy da; 155 RhsNested db; 156 }; 157 template < typename bk, typename ce, typename cf > 158 class z : public au< ak< bk, ce, cf > >::i {}; 159 template < typename as > int aj< as >::bo() const { (*this).bj(); __builtin_unreachable (); } 160 template < typename as > struct dc { 161 typedef typename ao< typename as::bg >::i ay; 162 enum { d, de }; 163 enum { df = de }; 164 }; 165 template < typename as > struct dk { 166 enum { dh, di, dj, alignment }; 167 typedef typename dc< as >::ay PacketScalar; 168 static PacketScalar dl(as dm, bc) { 169 return dm.template dn< alignment, PacketScalar >(di, dj); 170 } 171 }; 172 template < typename, typename as, int = dc< as >::df > struct redux_impl; 173 template < typename Func, typename as > struct redux_impl< Func, as, s > { 174 static int dl(as dm, Func func) { func.bd(dk< as >::dl(dm, func)); __builtin_unreachable (); } 175 }; 176 template < typename _XprType > class redux_evaluator { 177 public: 178 typedef _XprType cd; 179 redux_evaluator(cd bs) : m_evaluator(bs), m_xpr(bs) {} 180 typedef typename cd::bg bg; 181 template < int bw, typename ay > ay dn(x di, x dj) { 182 return m_evaluator.template bx< bw, ay >(dj, di); 183 } 184 br< cd > m_evaluator; 185 cd m_xpr; 186 }; 187 template < typename as > 188 template < typename Func > 189 typename ad< as >::bg bf< as >::bl(const Func &func) const { 190 typedef redux_evaluator< as > ThisEvaluator; 191 ThisEvaluator thisEval(bh()); 192 redux_impl< Func, ThisEvaluator >::dl(thisEval, func); 193 __builtin_unreachable (); 194 } 195 template < typename as > typename ad< as >::bg bf< as >::bj() const { 196 bl(bc()); 197 __builtin_unreachable (); 198 } 199 template < typename ExpressionType > 200 struct ad< al< ExpressionType > > : ad< typename ExpressionType::cv > {}; 201 template < typename > class al : public ap< al< ai< double, 2, 1 > > > { 202 public: 203 typedef aq::ar ck; 204 al(const ai< double, 2, 1 > &dg) : m_expression(dg) {} 205 const ai< double, 2, 1 > &dd() { return m_expression; } 206 ck m_expression; 207 }; 208 typedef ai< double, 2, 1 > Vector2d; 209 class OnHoverHandlerGraphicsItem { 210 public: 211 static Vector2d corners; 212 }; 213 int 214 GasGraphicsItemcreateOnHoverHandler() { 215 Vector2d l; 216 (l - OnHoverHandlerGraphicsItem::corners.array()).bo(); 217 __builtin_unreachable (); 218 } 219