On Tue, Sep 14, 2021 at 11:10 PM Yonghong Song <yhs@xxxxxx> wrote: > > Commit c240ba287890 ("selftests/bpf: Add a test with a bpf > program with btf_tag attributes") added btf_tag selftest > to test BTF_KIND_TAG generation from C source code, and to > test kernel validation of generated BTF types. > But if an old clang (clang 13 or earlier) is used, the > following compiler warning may be seen: > progs/tag.c:23:20: warning: unknown attribute 'btf_tag' ignored > and the test itself is marked OK. The compiler warning is bad > and the test itself shouldn't be marked OK. > > This patch added the check for btf_tag attribute support. > If btf_tag is not supported by the clang, the attribute will > not be used in the code and the test will be marked as skipped. > For example, with clang 13: > ./test_progs -t btf_tag > #21 btf_tag:SKIP > Summary: 1/0 PASSED, 1 SKIPPED, 0 FAILED > > The selftests/README.rst is updated to clarify when the btf_tag > test may be skipped. > > Signed-off-by: Yonghong Song <yhs@xxxxxx> Applied. Thanks for the quick follow up.