| 1 |
/* PR lto/99849 */ |
| 2 |
/* { dg-lto-do link } */ |
| 3 |
/* { dg-require-effective-target fpic } */ |
| 4 |
/* { dg-require-effective-target shared } */ |
| 5 |
/* { dg-extra-ld-options { -shared } } */ |
| 6 |
/* { dg-lto-options { { -std=gnu17 -flto -flto-partition=1to1 -O2 -Wno-incompatible-pointer-types -Wno-discarded-qualifiers -fPIC } } } */ |
| 7 |
|
| 8 |
struct { struct A *a; } *b; |
| 9 |
struct B { int *b; }; |
| 10 |
struct C { int *c; }; |
| 11 |
const struct D { struct C d; } d; |
| 12 |
struct A { struct { struct C e; }; }; |
| 13 |
struct E { void *e; } e = { &( &(const struct D) { (void *) &d })->d }; |
| 14 |
struct C f = { &( &(const struct D) { (void *) &d })->d }; |
| 15 |
struct A g[] = { &e, &f }; |
| 16 |
void foo () { b->a = g; } |
| 17 |
struct E h = { foo }; |
| 18 |
void bar (); |
| 19 |
int baz () { bar (h); } |
| 20 |
struct B i = { (int *) baz }; |
| 21 |
void qux (); |
| 22 |
void corge () { qux (i); } |
| 23 |
void *j __attribute__((__used__)) = corge; |