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++.dg/] [init/] [byval1.C] - Diff between revs 301 and 338

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

Rev 301 Rev 338
// PR c++/3948
// PR c++/3948
// Test that the destructor call for a value parameter gets the
// Test that the destructor call for a value parameter gets the
// right address.
// right address.
// { dg-do run }
// { dg-do run }
void *p[2];
void *p[2];
int i;
int i;
int r;
int r;
struct C
struct C
{
{
  int m;
  int m;
  C() { p[i++] = this; }
  C() { p[i++] = this; }
  ~C() { if (p[--i] != this) r = 1; }
  ~C() { if (p[--i] != this) r = 1; }
};
};
void Foo (C c)
void Foo (C c)
{
{
  p[i++] = &c;
  p[i++] = &c;
}
}
int main ()
int main ()
{
{
  C c;
  C c;
  Foo (c);
  Foo (c);
  return r;
  return r;
}
}
 
 

powered by: WebSVN 2.1.0

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