| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2 -fdump-tree-optimized" } */ |
| 3 |
|
| 4 |
struct a {int v1; |
| 5 |
int v2;}; |
| 6 |
struct b {struct a a[0];}; |
| 7 |
union c {struct b b;}; |
| 8 |
|
| 9 |
int |
| 10 |
test (struct b *bptr1, union c *cptr, int i, int j) |
| 11 |
{ |
| 12 |
bptr1->a[i].v1=123; |
| 13 |
cptr->b.a[j].v2=1; |
| 14 |
return bptr1->a[i].v1; |
| 15 |
} |
| 16 |
int |
| 17 |
test2 (struct b *bptr1, union c *cptr, int i, int j) |
| 18 |
{ |
| 19 |
bptr1->a[i].v1=124; |
| 20 |
cptr->b.a[j].v1=1; |
| 21 |
return bptr1->a[i].v1; |
| 22 |
} |
| 23 |
/* { dg-final { scan-tree-dump-times "return 123" 1 "optimized" { xfail *-*-* } } } */ |
| 24 |
/* { dg-final { scan-tree-dump-not "return 124" "optimized"} } */ |