| 1 |
/* Test that -gprune-btf does not prune through array members. */ |
| 2 |
|
| 3 |
/* { dg-do compile } */ |
| 4 |
/* { dg-options "-gbtf -gprune-btf -dA" } */ |
| 5 |
|
| 6 |
/* We expect full BTF information each struct. */ |
| 7 |
/* { dg-final { scan-assembler "TYPE \[0-9\]+ BTF_KIND_FWD 'file'" } } */ |
| 8 |
/* { dg-final { scan-assembler "TYPE \[0-9\]+ BTF_KIND_STRUCT 'A'" } } */ |
| 9 |
/* { dg-final { scan-assembler "TYPE \[0-9\]+ BTF_KIND_STRUCT 'B'" } } */ |
| 10 |
/* { dg-final { scan-assembler "TYPE \[0-9\]+ BTF_KIND_STRUCT 'C'" } } */ |
| 11 |
|
| 12 |
struct file; |
| 13 |
|
| 14 |
struct A { |
| 15 |
void *private; |
| 16 |
long (*read)(struct file *, char *, unsigned long); |
| 17 |
long (*write)(struct file *, const char *, unsigned long); |
| 18 |
}; |
| 19 |
|
| 20 |
struct B { |
| 21 |
unsigned int x; |
| 22 |
struct A **as; |
| 23 |
}; |
| 24 |
|
| 25 |
struct C { |
| 26 |
struct A *arr_a[4]; |
| 27 |
struct A *lone_a; |
| 28 |
unsigned int z; |
| 29 |
}; |
| 30 |
|
| 31 |
unsigned int |
| 32 |
foo (struct B *b, struct C *c) |
| 33 |
{ |
| 34 |
return b->x + c->z; |
| 35 |
} |