Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests/bpf: Fix btf_dump test under new clang

New clang version changed ([0]) type name in dwarf from "long int" to "long",
this is causing btf_dump tests to fail.

[0] https://github.com/llvm/llvm-project/commit/f6a561c4d6754b13165a49990e8365d819f64c86

Signed-off-by: Yucong Sun <sunyucong@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20211008173139.1457407-1-fallentree@fb.com

authored by

Yucong Sun and committed by
Andrii Nakryiko
7e3cbd34 dd65acf7

+9 -9
+5 -5
tools/testing/selftests/bpf/progs/btf_dump_test_case_bitfields.c
··· 11 11 /* 12 12 *struct bitfields_only_mixed_types { 13 13 * int a: 3; 14 - * long int b: 2; 14 + * long b: 2; 15 15 * _Bool c: 1; 16 16 * enum { 17 17 * A = 0, ··· 27 27 28 28 struct bitfields_only_mixed_types { 29 29 int a: 3; 30 - long int b: 2; 30 + long b: 2; 31 31 bool c: 1; /* it's really a _Bool type */ 32 32 enum { 33 33 A, /* A = 0, dumper is very explicit */ ··· 44 44 * char: 4; 45 45 * int a: 4; 46 46 * short b; 47 - * long int c; 48 - * long int d: 8; 47 + * long c; 48 + * long d: 8; 49 49 * int e; 50 50 * int f; 51 51 *}; ··· 71 71 *struct bitfield_flushed { 72 72 * int a: 4; 73 73 * long: 60; 74 - * long int b: 16; 74 + * long b: 16; 75 75 *}; 76 76 * 77 77 */
+2 -2
tools/testing/selftests/bpf/progs/btf_dump_test_case_packing.c
··· 29 29 struct nested_packed { 30 30 char: 4; 31 31 int a: 4; 32 - long int b; 32 + long b; 33 33 struct { 34 34 char c; 35 35 int d; ··· 44 44 45 45 union union_does_not_need_packing { 46 46 struct { 47 - long int a; 47 + long a; 48 48 int b; 49 49 } __attribute__((packed)); 50 50 int c;
+1 -1
tools/testing/selftests/bpf/progs/btf_dump_test_case_padding.c
··· 9 9 /* ----- START-EXPECTED-OUTPUT ----- */ 10 10 struct padded_implicitly { 11 11 int a; 12 - long int b; 12 + long b; 13 13 char c; 14 14 }; 15 15
+1 -1
tools/testing/selftests/bpf/progs/btf_dump_test_case_syntax.c
··· 189 189 const char *d; 190 190 } e; 191 191 union { 192 - volatile long int f; 192 + volatile long f; 193 193 void * restrict g; 194 194 }; 195 195 };