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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [torture/] [pr30567.C] - Blame information for rev 701

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

Line No. Rev Author Line
1 693 jeremybenn
/* { dg-do run } */
2
 
3
template 
4
struct const_ref
5
{
6
  const T* begin;
7
  const_ref(const T* b) : begin(b) {}
8
};
9
 
10
template 
11
T sum(const_ref const& a)
12
{
13
  T result = 0;
14
  for(unsigned i=0;i<1;i++) result += a.begin[i];
15
  return result;
16
}
17
 
18
struct tiny_plain
19
{
20
  int elems[2];
21
  tiny_plain() { elems[0]=1; }
22
};
23
 
24
struct vec3 : tiny_plain {};
25
 
26
struct mat3
27
{
28
  int type() const { return sum(const_ref(vec3().elems)) == 1; }
29
};
30
 
31
int main() { return mat3().type() ? 0 : 1; }
32
 

powered by: WebSVN 2.1.0

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