| 1 |
/* Test for BPF CO-RE __attribute__((preserve_access_index)) with accesses on |
| 2 |
LHS and both LHS and RHS of assignment. */ |
| 3 |
|
| 4 |
/* { dg-do compile } */ |
| 5 |
/* { dg-options "-O0 -dA -gbtf -mco-re -masm=normal" } */ |
| 6 |
|
| 7 |
struct T { |
| 8 |
int a; |
| 9 |
int b; |
| 10 |
struct U { |
| 11 |
int c; |
| 12 |
struct V { |
| 13 |
int d; |
| 14 |
int e[4]; |
| 15 |
int f; |
| 16 |
} v; |
| 17 |
} u; |
| 18 |
} __attribute__((preserve_access_index)); |
| 19 |
|
| 20 |
|
| 21 |
void |
| 22 |
func (struct T *t) |
| 23 |
{ |
| 24 |
/* 0:2:1:1:3 */ |
| 25 |
t->u.v.e[3] = 0xa1; |
| 26 |
|
| 27 |
/* 0:2:0, 0:0, 0:1 */ |
| 28 |
t->u.c = t->a + t->b; |
| 29 |
} |
| 30 |
|
| 31 |
/* { dg-final { scan-assembler-times "ascii \"0:2:1:1:3.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ |
| 32 |
/* { dg-final { scan-assembler-times "ascii \"0:2:0.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ |
| 33 |
/* { dg-final { scan-assembler-times "ascii \"0:0.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ |
| 34 |
/* { dg-final { scan-assembler-times "ascii \"0:1.0\"\[\t \]+\[^\n\]*btf_aux_string" 1 } } */ |
| 35 |
/* { dg-final { scan-assembler-times "bpfcr_type" 4 } } */ |