]> gcc.gnu.org Git - gcc.git/blob - gcc/testsuite/g++.dg/torture/pr43879-1_1.C
re PR tree-optimization/43879 (-fipa-pta causes various miscompilations)
[gcc.git] / gcc / testsuite / g++.dg / torture / pr43879-1_1.C
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
This page took 0.038055 seconds and 5 git commands to generate.