OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc2/] [gcc/] [testsuite/] [g++.dg/] [opt/] [pr19317-1.C] - Diff between revs 301 and 384

Only display areas with differences | Details | Blame | View Log

Rev 301 Rev 384
// PR c++/19317
// PR c++/19317
// { dg-options "-O2" }
// { dg-options "-O2" }
// { dg-do run }
// { dg-do run }
// Origin: Dirk Mueller 
// Origin: Dirk Mueller 
extern "C" void abort (void);
extern "C" void abort (void);
struct A
struct A
{
{
  A () { d = e = 0; f = -1; }
  A () { d = e = 0; f = -1; }
  A (int x) : d (0), e (0), f (x) { }
  A (int x) : d (0), e (0), f (x) { }
  A b (const A &r) const;
  A b (const A &r) const;
  int d;
  int d;
  int e;
  int e;
  int f;
  int f;
};
};
A
A
A::b (const A & r) const
A::b (const A & r) const
{
{
  A t;
  A t;
  t.f = f < r.f ? f : r.f;
  t.f = f < r.f ? f : r.f;
  return t;
  return t;
}
}
int
int
main ()
main ()
{
{
  A a (100);
  A a (100);
  a = a.b (A (10));
  a = a.b (A (10));
  if (a.f != 10)
  if (a.f != 10)
    abort ();
    abort ();
  A c (10);
  A c (10);
  A d (100);
  A d (100);
  c = d.b (c);
  c = d.b (c);
  if (c.f != 10)
  if (c.f != 10)
    abort ();
    abort ();
}
}
 
 

powered by: WebSVN 2.1.0

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