| 1 |
// { dg-lto-do assemble } |
| 2 |
extern void some_function (const char *); |
| 3 |
extern bool some_other_function (); |
| 4 |
|
| 5 |
struct Foo |
| 6 |
{ |
| 7 |
long long a; |
| 8 |
int b; |
| 9 |
}; |
| 10 |
|
| 11 |
bool Foo_eq(Foo x, Foo y) |
| 12 |
{ |
| 13 |
return x.a == y.a && x.b == y.b; |
| 14 |
} |
| 15 |
|
| 16 |
struct Bar |
| 17 |
{ |
| 18 |
Foo a; |
| 19 |
int b; |
| 20 |
}; |
| 21 |
|
| 22 |
struct Baz |
| 23 |
{ |
| 24 |
Bar a; |
| 25 |
Baz(Bar &a):a(a) { } |
| 26 |
}; |
| 27 |
|
| 28 |
#pragma GCC diagnostic ignored "-Wreturn-type" |
| 29 |
struct Zonk |
| 30 |
{ |
| 31 |
Baz baz; |
| 32 |
|
| 33 |
Bar func_1(const Bar & bar) { |
| 34 |
if (Foo_eq(bar.a, baz.a.a) && bar.b == baz.a.b || some_other_function ()) |
| 35 |
return bar; |
| 36 |
} |
| 37 |
|
| 38 |
void func_2(const Baz & baz) { |
| 39 |
func_1(baz.a); |
| 40 |
some_function(__PRETTY_FUNCTION__); |
| 41 |
} |
| 42 |
}; |
| 43 |
|
| 44 |
void func() { |
| 45 |
Bar bar; |
| 46 |
Zonk *rep; |
| 47 |
rep->func_1(bar); |
| 48 |
rep->func_2(Baz(bar)); |
| 49 |
} |
| 50 |
|
| 51 |
void foo () |
| 52 |
{ |
| 53 |
func(); |
| 54 |
} |