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/] [ext/] [cleanup-dtor.C] - Diff between revs 301 and 338

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

Rev 301 Rev 338
// Check that destructors are run after cleanup functions.
// Check that destructors are run after cleanup functions.
// { dg-do run }
// { dg-do run }
extern "C" void abort ();
extern "C" void abort ();
int i;
int i;
struct S {
struct S {
  ~S() {
  ~S() {
    if (i != 1)
    if (i != 1)
      abort ();
      abort ();
    i = 2;
    i = 2;
  }
  }
};
};
void f(void *) {
void f(void *) {
  if (i != 0)
  if (i != 0)
    abort ();
    abort ();
  i = 1;
  i = 1;
}
}
int main () {
int main () {
  {
  {
    S s __attribute__((cleanup (f)));
    S s __attribute__((cleanup (f)));
  }
  }
  if (i != 2)
  if (i != 2)
    abort ();
    abort ();
}
}
 
 

powered by: WebSVN 2.1.0

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