Debian Codegraph @

gcc/testsuite/gcc.dg/debug/btf/btf-prune-1.c

raw
1 /* Simple test of -gprune-btf option operation.
2 Since 'struct foo' is not used, no BTF shall be emitted for it. */
3
4 /* { dg-do compile } */
5 /* { dg-options "-gbtf -gprune-btf -dA" } */
6
7 /* No BTF info for 'struct foo' nor types used only by it. */
8 /* { dg-final { scan-assembler-not "BTF_KIND_STRUCT 'foo'" } } */
9 /* { dg-final { scan-assembler-not "BTF_KIND_INT 'char'" } } */
10
11 /* We should get BTF info for 'struct bar' since it is used. */
12 /* { dg-final { scan-assembler "BTF_KIND_STRUCT 'bar'"} } */
13
14 struct foo {
15 int a;
16 char c;
17 };
18
19 struct bar {
20 int x;
21 long z[4];
22 };
23
24 struct bar a_bar;
25