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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [ext/] [cleanup-dtor.C] - Blame information for rev 801

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// Check that destructors are run after cleanup functions.
2
// { dg-do run }
3
 
4
extern "C" void abort ();
5
 
6
int i;
7
 
8
struct S {
9
  ~S() {
10
    if (i != 1)
11
      abort ();
12
    i = 2;
13
  }
14
};
15
 
16
void f(void *) {
17
  if (i != 0)
18
    abort ();
19
  i = 1;
20
}
21
 
22
int main () {
23
  {
24
    S s __attribute__((cleanup (f)));
25
  }
26
  if (i != 2)
27
    abort ();
28
}

powered by: WebSVN 2.1.0

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