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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.dg/] [other/] [pr30567.C] - Diff between revs 149 and 154

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 149 Rev 154
/* { dg-do run } */
/* { dg-do run } */
/* { dg-options "-O -finline-functions -fstrict-aliasing" } */
/* { dg-options "-O -finline-functions -fstrict-aliasing" } */
template 
template 
struct const_ref
struct const_ref
{
{
  const T* begin;
  const T* begin;
  const_ref(const T* b) : begin(b) {}
  const_ref(const T* b) : begin(b) {}
};
};
template 
template 
T sum(const_ref const& a)
T sum(const_ref const& a)
{
{
  T result = 0;
  T result = 0;
  for(unsigned i=0;i<1;i++) result += a.begin[i];
  for(unsigned i=0;i<1;i++) result += a.begin[i];
  return result;
  return result;
}
}
struct tiny_plain
struct tiny_plain
{
{
  int elems[2];
  int elems[2];
  tiny_plain() { elems[0]=1; }
  tiny_plain() { elems[0]=1; }
};
};
struct vec3 : tiny_plain {};
struct vec3 : tiny_plain {};
struct mat3
struct mat3
{
{
  int type() const { return sum(const_ref(vec3().elems)) == 1; }
  int type() const { return sum(const_ref(vec3().elems)) == 1; }
};
};
int main() { return mat3().type() ? 0 : 1; }
int main() { return mat3().type() ? 0 : 1; }
 
 

powered by: WebSVN 2.1.0

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