| 1 |
/* { dg-lto-do run } */ |
| 2 |
/* { dg-lto-options {{-O2 -flto -fno-strict-aliasing -fno-ipa-cp --disable-tree-esra -fdump-ipa-icf-details }} } */ |
| 3 |
|
| 4 |
#define CI 0xdeadbeef |
| 5 |
#define CL1 0xdeaddead1234beef |
| 6 |
#define CL2 0xdead1234deadbeef |
| 7 |
|
| 8 |
struct SA |
| 9 |
{ |
| 10 |
unsigned int ax; |
| 11 |
unsigned long long ay; |
| 12 |
unsigned long long az; |
| 13 |
}; |
| 14 |
|
| 15 |
struct SB |
| 16 |
{ |
| 17 |
unsigned int bx; |
| 18 |
unsigned long long by; |
| 19 |
unsigned long long bz; |
| 20 |
}; |
| 21 |
|
| 22 |
struct ZA |
| 23 |
{ |
| 24 |
int p; |
| 25 |
struct SA s; |
| 26 |
short q; |
| 27 |
}; |
| 28 |
|
| 29 |
struct ZB |
| 30 |
{ |
| 31 |
int p; |
| 32 |
struct SB s; |
| 33 |
short q; |
| 34 |
}; |
| 35 |
|
| 36 |
void __attribute__((noinline)) |
| 37 |
geta (struct SA *d, struct ZA *p) |
| 38 |
{ |
| 39 |
struct SA tmp = p->s; |
| 40 |
*d = tmp; |
| 41 |
} |
| 42 |
|
| 43 |
void getb (struct SB *d, struct ZB *p); |
| 44 |
|
| 45 |
struct ZA ga; |
| 46 |
struct ZB gb; |
| 47 |
|
| 48 |
void __attribute__((noipa)) |
| 49 |
init (void) |
| 50 |
{ |
| 51 |
ga.s.ax = CI; |
| 52 |
ga.s.ay = CL1; |
| 53 |
ga.s.az = CL2; |
| 54 |
|
| 55 |
gb.s.bx = CI; |
| 56 |
gb.s.by = CL1; |
| 57 |
gb.s.bz = CL2; |
| 58 |
} |
| 59 |
|
| 60 |
int |
| 61 |
main (int argc, char **argv) |
| 62 |
{ |
| 63 |
init(); |
| 64 |
struct SA a; |
| 65 |
geta (&a, &ga); |
| 66 |
|
| 67 |
if (a.ax != CI) |
| 68 |
__builtin_abort (); |
| 69 |
if (a.ay != CL1) |
| 70 |
__builtin_abort (); |
| 71 |
if (a.az != CL2) |
| 72 |
__builtin_abort (); |
| 73 |
|
| 74 |
struct SB b; |
| 75 |
getb (&b, &gb); |
| 76 |
|
| 77 |
if (b.bx != CI) |
| 78 |
__builtin_abort (); |
| 79 |
if (b.by != CL1) |
| 80 |
__builtin_abort (); |
| 81 |
if (b.bz != CL2) |
| 82 |
__builtin_abort (); |
| 83 |
|
| 84 |
return 0; |
| 85 |
} |
| 86 |
|
| 87 |
/* { dg-final { scan-wpa-ipa-dump "Semantic equality hit:geta/.*getb/" "icf" } } */ |