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
Daily bump.
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
torture
/
pr47541.C
blob
350a05192979b53933d77ed4a7d569c8763740e8
1
/* { dg-do run } */
2
3
struct Dummy {};
4
struct RefCount : public Dummy {
5
~RefCount(); /* Has to be non-pod. */
6
int *a;
7
int *b;
8
};
9
RefCount::~RefCount(){}
10
struct Wrapper : public Dummy { RefCount ref; };
11
void __attribute__((noinline,noclone))
12
Push(Wrapper ptr)
13
{
14
*ptr.ref.b = 0;
15
}
16
extern "C" void abort (void);
17
int main()
18
{
19
int a = 1, b = 1;
20
Wrapper x;
21
x.ref.a = &a;
22
x.ref.b = &b;
23
Push(x);
24
if (b != 0)
25
abort ();
26
return 0;
27
}