Commit d503f117 authored by Eduard Zingerman's avatar Eduard Zingerman Committed by Andrii Nakryiko

selftests/bpf: Test btf dump for struct with padding only fields

Structures with zero regular fields but some padding constitute a
special case in btf_dump.c:btf_dump_emit_struct_def with regards to
newline before closing '}'.
Signed-off-by: default avatarEduard Zingerman <eddyz87@gmail.com>
Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20221001104425.415768-2-eddyz87@gmail.com
parent 44a726c3
......@@ -102,12 +102,21 @@ struct zone {
struct zone_padding __pad__;
};
/* ----- START-EXPECTED-OUTPUT ----- */
struct padding_wo_named_members {
long: 64;
long: 64;
};
/* ------ END-EXPECTED-OUTPUT ------ */
int f(struct {
struct padded_implicitly _1;
struct padded_explicitly _2;
struct padded_a_lot _3;
struct padded_cache_line _4;
struct zone _5;
struct padding_wo_named_members _6;
} *_)
{
return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment