| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O0 -dA -gbtf -mco-re -masm=normal" } */ |
| 3 |
|
| 4 |
struct T { |
| 5 |
int a; |
| 6 |
int b; |
| 7 |
struct U { |
| 8 |
int c; |
| 9 |
struct V { |
| 10 |
int d; |
| 11 |
int e[4]; |
| 12 |
int f; |
| 13 |
} v; |
| 14 |
} u; |
| 15 |
}; |
| 16 |
|
| 17 |
void func (struct T * foo) |
| 18 |
{ |
| 19 |
/* Access string: "0:2:1:1:3" */ |
| 20 |
int *x; |
| 21 |
int *y; |
| 22 |
__builtin_preserve_access_index (({ |
| 23 |
x = &(foo->u.v.e[3]); |
| 24 |
struct U *tmp = &(foo->u); |
| 25 |
y = &(tmp->v.f); |
| 26 |
})); |
| 27 |
|
| 28 |
*x = 17; |
| 29 |
*y = 16; |
| 30 |
} |
| 31 |
|
| 32 |
/* { dg-final { scan-assembler-times "ascii \"0:2:1:1:3.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ |
| 33 |
/* { dg-final { scan-assembler-times "ascii \"0:2.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ |
| 34 |
/* { dg-final { scan-assembler-times "ascii \"0:1:2.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ |
| 35 |
/* { dg-final { scan-assembler-times "bpfcr_type" 3 } } */ |