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
Update ChangeLog and version files for release
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
torture
/
pr43879-1_1.C
blob
0c943381fa325a6add73f90df2310aa362d342e8
1
/* { dg-do run } */
2
/* { dg-options "-fipa-pta" } */
3
/* { dg-additional-sources "pr43879-1_0.C" } */
4
5
struct A {
6
int *i;
7
A();
8
~A();
9
};
10
11
static inline int
12
aa(int *a, int *b)
13
{
14
(void)b;
15
return *a;
16
}
17
18
struct B {
19
B() : i(0) {}
20
int i;
21
B(const A &a) : i(0)
22
{
23
f(*a.i);
24
}
25
void __attribute__((noinline, noclone))
26
f(int j)
27
{
28
aa(&i, &j);
29
i = 1;
30
}
31
};
32
33
int
34
test()
35
{
36
B b1;
37
B b2 = B(A());
38
b1 = B(A());
39
if (b1.i != b2.i) __builtin_abort();
40
return 0;
41
}
42
43
int
44
main()
45
{
46
return test();
47
}
48