repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Clean up some minor white space issues in trans-decl.c and trans-expr.c
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
ext
/
cleanup-dtor.C
blob
58da646704ba0d221484d662709348ac9e277be3
1
// 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
}