On 12/13/19 3:51 PM, Andrii Nakryiko wrote: > Add a set of tests validating libbpf-provided extern variables. One crucial > feature that's tested is dead code elimination together with using invalid BPF > helper. CONFIG_MISSING is not supposed to exist and should always be specified > by libbpf as zero, which allows BPF verifier to correctly do branch pruning > and not fail validation, when invalid BPF helper is called from dead if branch. > > Signed-off-by: Andrii Nakryiko <andriin@xxxxxx> > --- > .../selftests/bpf/prog_tests/core_extern.c | 193 ++++++++++++++++++ > .../selftests/bpf/prog_tests/skeleton.c | 18 +- > .../selftests/bpf/progs/test_core_extern.c | 62 ++++++ > .../selftests/bpf/progs/test_skeleton.c | 9 + > 4 files changed, 281 insertions(+), 1 deletion(-) > create mode 100644 tools/testing/selftests/bpf/prog_tests/core_extern.c > create mode 100644 tools/testing/selftests/bpf/progs/test_core_extern.c > > diff --git a/tools/testing/selftests/bpf/prog_tests/core_extern.c b/tools/testing/selftests/bpf/prog_tests/core_extern.c > new file mode 100644 > index 000000000000..4f5f8439cb02 > --- /dev/null > +++ b/tools/testing/selftests/bpf/prog_tests/core_extern.c > @@ -0,0 +1,193 @@ > +// SPDX-License-Identifier: GPL-2.0 > +#include <test_progs.h> copyright just for consistency ? > +++ b/tools/testing/selftests/bpf/progs/test_core_extern.c > @@ -0,0 +1,62 @@ > +// SPDX-License-Identifier: GPL-2.0 > +// Copyright (c) 2017 Facebook > + wrong year and format. It should be C style comment /* */ > --- a/tools/testing/selftests/bpf/progs/test_skeleton.c > +++ b/tools/testing/selftests/bpf/progs/test_skeleton.c > @@ -1,6 +1,7 @@ > // SPDX-License-Identifier: GPL-2.0 > // Copyright (c) 2017 Facebook ditto