| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O1 -fdump-tree-optimized -fdump-tree-esra-details" } */ |
| 3 |
|
| 4 |
typedef struct teststruct |
| 5 |
{ |
| 6 |
double d; |
| 7 |
int i1; |
| 8 |
char c1; |
| 9 |
float z; |
| 10 |
char c2; |
| 11 |
int i2; |
| 12 |
} teststruct; |
| 13 |
|
| 14 |
void link_error (void); |
| 15 |
|
| 16 |
void cow (int i) |
| 17 |
{ |
| 18 |
teststruct a, b, c, d; |
| 19 |
|
| 20 |
a.d = 3.2; |
| 21 |
a.i1 = i; |
| 22 |
|
| 23 |
b = a; |
| 24 |
c = b; |
| 25 |
d = c; |
| 26 |
|
| 27 |
if (d.i1 != i) |
| 28 |
link_error (); |
| 29 |
} |
| 30 |
|
| 31 |
|
| 32 |
/* Suaccesses of b and c should have been created. */ |
| 33 |
/* { dg-final { scan-tree-dump "expr = b.d" "esra"} } */ |
| 34 |
/* { dg-final { scan-tree-dump "expr = b.i1" "esra"} } */ |
| 35 |
/* { dg-final { scan-tree-dump "expr = c.d" "esra"} } */ |
| 36 |
/* { dg-final { scan-tree-dump "expr = c.i1" "esra"} } */ |
| 37 |
|
| 38 |
/* There should be no reference to link_error. */ |
| 39 |
/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized"} } */ |