OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.dg/] [torture/] [pr44069.C] - Blame information for rev 320

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 301 jeremybenn
/* { dg-do run } */
2
 
3
template 
4
class M {
5
public:
6
    M(const int* arr) {
7
        for (unsigned long r = 0; r < R; ++r)
8
          for (unsigned long c = 0; c < C; ++c)
9
            m[r*C+c] = arr[r*C+c];
10
    }
11
    int operator()(unsigned r, unsigned c) const
12
      { return m[r*C+c]; }
13
private:
14
    int m[R*C];
15
};
16
extern "C" void abort (void);
17
int main()
18
{
19
  int vals[2][2] = { { 1, 2 }, { 5, 6 } };
20
  M<2,2> m( &(vals[0][0]) );
21
  if (m(1,0) != 5)
22
    abort ();
23
  return 0;
24
}
25
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.