10SN/A// { dg-do compile }
22362SN/A// { dg-additional-options "-Wno-psabi" }
30SN/A// Ignore warning on some powerpc-linux configurations.
40SN/A// { dg-prune-output "non-standard ABI extension" }
50SN/A
60SN/Atypedef float __m128 __attribute__ ((__vector_size__ (16)));
72362SN/Aconst int a = 0;
80SN/Aenum
92362SN/A{
100SN/A  ReadOnlyAccessors
110SN/A};
120SN/Atemplate <typename> struct traits;
130SN/Astruct A
140SN/A{
150SN/A  enum
160SN/A  {
170SN/A    value = 1
180SN/A  };
190SN/A};
200SN/Atemplate <typename> struct EigenBase;
212362SN/Atemplate <typename> class J;
222362SN/Atemplate <typename, int = A::value> class DenseCoeffsBase;
232362SN/Atemplate <typename, int, int, int = 0, int = 0, int = 0> class K;
240SN/Atemplate <typename> class N;
250SN/Atemplate <typename, typename> class CwiseUnaryOp;
260SN/Atemplate <typename> class L;
270SN/Atemplate <typename> class P;
280SN/Atemplate <typename> struct B;
290SN/Atemplate <typename> struct C;
300SN/Atemplate <typename Derived> struct dense_xpr_base
310SN/A{
320SN/A  typedef N<Derived> type;
330SN/A};
340SN/Atemplate <typename Packet> void padd (Packet);
350SN/Atemplate <> struct C<float>
360SN/A{
370SN/A  typedef __m128 type;
380SN/A};
390SN/Astruct D
400SN/A{
410SN/A  void
420SN/A  packetOp (C<float>::type)
430SN/A  {
440SN/A    __m128 b = { m_other };
450SN/A    padd (b);
460SN/A  }
470SN/A  float m_other;
480SN/A};
490SN/Atemplate <typename Derived>
500SN/Aclass DenseCoeffsBase<Derived, ReadOnlyAccessors> : public EigenBase<Derived>
510SN/A{
520SN/Apublic:
530SN/A  typedef typename C<typename traits<Derived>::Scalar>::type PacketScalar;
540SN/A};
550SN/Atemplate <typename Derived>
560SN/Aclass DenseCoeffsBase<Derived>
570SN/A    : public DenseCoeffsBase<Derived, ReadOnlyAccessors>
580SN/A{
590SN/Apublic:
600SN/A  template <typename OtherDerived, int, int LoadMode>
610SN/A  void
620SN/A  copyPacket (typename traits<Derived>::Index, J<OtherDerived> p2)
630SN/A  {
640SN/A    p2.derived ().template packet<LoadMode> (0);
650SN/A  }
660SN/A};
670SN/Atemplate <typename Derived> class J : public DenseCoeffsBase<Derived>
680SN/A{
690SN/Apublic:
700SN/A  using DenseCoeffsBase<Derived>::derived;
710SN/A  template <typename OtherDerived>
720SN/A  Derived &lazyAssign (const J<OtherDerived> &);
730SN/A};
740SN/Atemplate <typename Derived> class N : public J<Derived>
750SN/A{
760SN/Apublic:
770SN/A  template <typename OtherDerived>
780SN/A  typename B<OtherDerived>::Type operator*(N<OtherDerived>);
790SN/A  L<Derived> array ();
800SN/A};
810SN/Atemplate <typename Derived> struct EigenBase
820SN/A{
830SN/A  Derived
840SN/A  derived () const
850SN/A  {
860SN/A    return *static_cast<const Derived *> (this);
870SN/A  }
880SN/A};
890SN/Atemplate <typename Derived1, typename Derived2> struct F
900SN/A{
910SN/A  static void
920SN/A  run (Derived1 p1, Derived2 p2)
930SN/A  {
940SN/A    enum
950SN/A    {
960SN/A      srcAlignment
970SN/A    };
980SN/A    for (;;)
990SN/A      p1.template copyPacket<Derived2, 0, srcAlignment> (0, p2);
1000SN/A  }
1010SN/A};
1020SN/Atemplate <typename Derived>
1030SN/Atemplate <typename OtherDerived>
1040SN/ADerived &
1050SN/AJ<Derived>::lazyAssign (const J<OtherDerived> &p1)
1060SN/A{
1070SN/A  F<Derived, OtherDerived>::run (derived (), p1.derived ());
1080SN/A}
1090SN/Atemplate <typename Derived, typename OtherDerived> struct G
1100SN/A{
1110SN/A  static Derived
1120SN/A  run (Derived p1, OtherDerived p2)
1130SN/A  {
1140SN/A    p1.lazyAssign (p2);
1150SN/A  }
1160SN/A};
1170SN/Aclass H
1180SN/A{
1190SN/Apublic:
1200SN/A  H (int, int, int);
1210SN/A};
1220SN/Atemplate <typename Derived> class M : public dense_xpr_base<Derived>::type
1230SN/A{
1240SN/Apublic:
1250SN/A  typedef typename traits<Derived>::Index Index;
1260SN/A  H m_storage;
1270SN/A  M (Index, Index, Index) : m_storage (0, 0, 0) {}
1280SN/A  template <typename OtherDerived>
1290SN/A  void
1300SN/A  _set_noalias (J<OtherDerived> p1)
1310SN/A  {
1320SN/A    G<Derived, OtherDerived>::run (this->derived (), p1.derived ());
1330SN/A  }
1340SN/A};
1350SN/Atemplate <typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows,
1360SN/A          int _MaxCols>
1370SN/Astruct traits<K<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> >
1380SN/A{
1390SN/A  typedef _Scalar Scalar;
1400SN/A  typedef int StorageKind;
1410SN/A  typedef int Index;
1420SN/A};
1430SN/Atemplate <typename, int _Rows, int _Cols, int, int, int>
1440SN/Aclass K : public M<K<float, _Rows, _Cols> >
1450SN/A{
1460SN/Apublic:
1470SN/A  typedef M<K> Base;
1480SN/A  typedef K Nested;
1490SN/A  template <typename T0, typename T1> K (T0, T1);
1500SN/A  template <typename OtherDerived> K (N<OtherDerived> p1) : Base (0, 0, 0)
1510SN/A  {
1520SN/A    Base::_set_noalias (p1);
1530SN/A  }
1540SN/A};
1550SN/Atemplate <typename UnaryOp, typename XprType>
1560SN/Astruct traits<CwiseUnaryOp<UnaryOp, XprType> > : traits<XprType>
1570SN/A{
1580SN/A};
1590SN/Atemplate <typename, typename, typename> class I;
1600SN/Atemplate <typename, typename XprType>
1610SN/Aclass CwiseUnaryOp
1620SN/A    : public I<D, XprType, typename traits<XprType>::StorageKind>
1630SN/A{
1640SN/Apublic:
1650SN/A  D
1660SN/A  functor ()
1670SN/A  {
1680SN/A    return m_functor;
1690SN/A  }
1700SN/A  typename XprType::Nested nestedExpression ();
1710SN/A  D m_functor;
1720SN/A};
1730SN/Atemplate <typename UnaryOp, typename XprType>
1740SN/Aclass I<UnaryOp, XprType, int>
1750SN/A    : public dense_xpr_base<CwiseUnaryOp<UnaryOp, XprType> >::type
1760SN/A{
1770SN/Apublic:
1780SN/A  typedef CwiseUnaryOp<UnaryOp, XprType> Derived;
1790SN/A  typedef typename dense_xpr_base<CwiseUnaryOp<UnaryOp, XprType> >::type Base;
1800SN/A  typedef Derived Nested;
1810SN/A  using Base::derived;
1820SN/A  template <int LoadMode> void packet (typename traits<Derived>::Index)
1830SN/A  {
1840SN/A    derived ().functor ().packetOp (
1850SN/A        derived ().nestedExpression ().template packet<LoadMode> (0));
1860SN/A  }
1870SN/A};
1880SN/Atemplate <typename> struct B
1890SN/A{
1900SN/A  typedef P<CwiseUnaryOp<D, L<K<float, 0, 1> > > > Type;
1910SN/A};
1920SN/Atemplate <typename Derived> class O : public J<Derived>
1930SN/A{
1940SN/Apublic:
1950SN/A  P<Derived> matrix ();
1960SN/A};
1970SN/Atemplate <typename ExpressionType>
1980SN/Astruct traits<L<ExpressionType> > : traits<typename ExpressionType::Nested>
1990SN/A{
2000SN/A};
2010SN/Atemplate <typename ExpressionType> class L : public O<L<ExpressionType> >
2020SN/A{
2030SN/Apublic:
2040SN/A  typedef L Nested;
2050SN/A  template <int>
2060SN/A  typename O<L>::PacketScalar packet (typename traits<L>::Index);
2070SN/A};
2080SN/Atemplate <typename ExpressionType>
2090SN/Astruct traits<P<ExpressionType> > : traits<typename ExpressionType::Nested>
2100SN/A{
2110SN/A};
2120SN/Atemplate <typename ExpressionType> class P : public N<P<ExpressionType> >
2130SN/A{
2140SN/Apublic:
2150SN/A  N<P> Base;
2160SN/A  template <int LoadMode> void packet (typename traits<P>::Index)
2170SN/A  {
2180SN/A    m_expression.template packet<LoadMode> (0);
2190SN/A  }
2200SN/A  ExpressionType m_expression;
2210SN/A};
2220SN/Aint
2230SN/Amain ()
2240SN/A{
2250SN/A  K<float, 0, a> m (0, 0);
2260SN/A  K<float, 0, 1> c (0, 0);
2270SN/A  c = m.array ().matrix () * m;
2280SN/A}
2290SN/A