Create embedded-5_0-branch branch for development on ARM embedded cores.
[official-gcc.git] / embedded-5_0-branch / gcc / testsuite / g++.dg / graphite / pr43026.C
blobc880197035f801dd8f1004a9040d72aba66fcafe
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fgraphite-identity" } */
4 template<typename Tp > class vector { };
6 template <int rank, int dim> class Tensor;
8 template <int dim> class Tensor<1,dim> {
9 public:
10   Tensor (const Tensor<1,dim> &);
11 private:
12   double values[(dim != 0) ? (dim) : 1];
15 template <int dim>
16 #ifdef NOINLINE
17 // declaring this noinline prevents the ICE
18 __attribute__ ((noinline))
19 #endif
20 Tensor<1,dim>::Tensor (const Tensor<1,dim> &p)
22   for (unsigned int i = 0; i < dim; ++i)
23     values[i] = p.values[i];
26 template <int rank, int dim>
27 class Tensor {
28   Tensor<rank-1,dim> subtensor[dim];
31 template <int dim> class Base {
32 public:
33   const unsigned int npoints;
34   const unsigned int dofs;
35   const Tensor<2,dim> &s2d (const unsigned int fno,
36                             const unsigned int pno) const;
37   void getf2d (vector<Tensor<2,dim> >& d2) const;
40 template <int dim>
41 void Base<dim>:: getf2d
42   (vector<Tensor<2,dim> > &d2) const
44   unsigned int point, sf;
46   for (point = 0; point < npoints; ++point)
47     for (sf = 0; sf < dofs; ++sf)
48       Tensor<2,dim> tmp = s2d (sf, point);
51 template void Base<3>::getf2d (vector<Tensor<2,3> > &) const;