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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.jason/] [temporary8.C] - Diff between revs 305 and 338

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

Rev 305 Rev 338
// { dg-do run  }
// { dg-do run  }
// Test for proper handling of temporaries in ?: exprs.
// Test for proper handling of temporaries in ?: exprs.
extern "C" int printf (const char *, ...);
extern "C" int printf (const char *, ...);
int c = 0, d = 0;
int c = 0, d = 0;
class A {
class A {
public:
public:
  A() { ++c; }
  A() { ++c; }
  A(const A&) { ++c; }
  A(const A&) { ++c; }
  ~A() { ++d; }
  ~A() { ++d; }
};
};
A f (const A& a)
A f (const A& a)
{
{
  return (c ? A() : A());
  return (c ? A() : A());
}
}
int main()
int main()
{
{
  {
  {
    f (c ? A() : A());
    f (c ? A() : A());
  }
  }
  printf ("%d %d\n", c, d);
  printf ("%d %d\n", c, d);
  return c != d || c != 2;
  return c != d || c != 2;
}
}
 
 

powered by: WebSVN 2.1.0

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