On Tue, Feb 23, 2021 at 12:16 PM Ilya Leoshkevich <iii@xxxxxxxxxxxxx> wrote: > > On Mon, 2021-02-22 at 23:11 -0800, Andrii Nakryiko wrote: > > On Mon, Feb 22, 2021 at 1:52 PM Ilya Leoshkevich <iii@xxxxxxxxxxxxx> > > wrote: > > > > > > Test the good variants as well as the potential malformed ones. > > > > > > Signed-off-by: Ilya Leoshkevich <iii@xxxxxxxxxxxxx> > > > Acked-by: Yonghong Song <yhs@xxxxxx> > > > --- > > > > Would be nice to have BTF dumping and dedup tests added/adjusted as > > well. > > > > > tools/testing/selftests/bpf/btf_helpers.c | 4 + > > > tools/testing/selftests/bpf/prog_tests/btf.c | 129 > > > +++++++++++++++++++ > > > tools/testing/selftests/bpf/test_btf.h | 3 + > > > 3 files changed, 136 insertions(+) > > > > > > > [...] > > I will add a dedup in the next series, but dumping test requires LLVM > support, so it will have to come later separately. Still, in my local > setup the following works: Awesome, thanks for checking! > > --- a/tools/testing/selftests/bpf/progs/btf_dump_test_case_syntax.c > +++ b/tools/testing/selftests/bpf/progs/btf_dump_test_case_syntax.c > @@ -205,6 +205,12 @@ struct struct_with_embedded_stuff { > int t[11]; > }; > > +struct float_struct { > + float *f; > + const double *d; > + volatile long double *ld; > +}; > + > struct root_struct { > enum e1 _1; > enum e2 _2; > @@ -219,6 +225,7 @@ struct root_struct { > union_fwd_t *_12; > union_fwd_ptr_t _13; > struct struct_with_embedded_stuff _14; > + struct float_struct _15; > }; > > /* ------ END-EXPECTED-OUTPUT ------ */ > >