selftests/bpf: Fix btf_dump test under new clang
authorYucong Sun <sunyucong@gmail.com>
Fri, 8 Oct 2021 17:31:39 +0000 (10:31 -0700)
committerAndrii Nakryiko <andrii@kernel.org>
Fri, 8 Oct 2021 18:08:11 +0000 (11:08 -0700)
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
tools/testing/selftests/bpf/progs/btf_dump_test_case_bitfields.c
tools/testing/selftests/bpf/progs/btf_dump_test_case_packing.c
tools/testing/selftests/bpf/progs/btf_dump_test_case_padding.c
tools/testing/selftests/bpf/progs/btf_dump_test_case_syntax.c

index 8f44767a75fa5ffc5b91c6a5da1239127798a7fd..e5560a6560309b97cfa52d229d0d38e487760e87 100644 (file)
@@ -11,7 +11,7 @@
 /*
  *struct bitfields_only_mixed_types {
  *     int a: 3;
- *     long int b: 2;
+ *     long b: 2;
  *     _Bool c: 1;
  *     enum {
  *             A = 0,
@@ -27,7 +27,7 @@
 
 struct bitfields_only_mixed_types {
        int a: 3;
-       long int b: 2;
+       long b: 2;
        bool c: 1; /* it's really a _Bool type */
        enum {
                A, /* A = 0, dumper is very explicit */
@@ -44,8 +44,8 @@ struct bitfields_only_mixed_types {
  *     char: 4;
  *     int a: 4;
  *     short b;
- *     long int c;
- *     long int d: 8;
+ *     long c;
+ *     long d: 8;
  *     int e;
  *     int f;
  *};
@@ -71,7 +71,7 @@ struct bitfield_mixed_with_others {
  *struct bitfield_flushed {
  *     int a: 4;
  *     long: 60;
- *     long int b: 16;
+ *     long b: 16;
  *};
  *
  */
index 1cef3bec1dc7f630bebb4d471118033a9166283d..e304b6204bd9d7016c33ecfd7765c202fb162c96 100644 (file)
@@ -29,7 +29,7 @@ struct non_packed_fields {
 struct nested_packed {
        char: 4;
        int a: 4;
-       long int b;
+       long b;
        struct {
                char c;
                int d;
@@ -44,7 +44,7 @@ union union_is_never_packed {
 
 union union_does_not_need_packing {
        struct {
-               long int a;
+               long a;
                int b;
        } __attribute__((packed));
        int c;
index 35c512818a56b8928a4337208ae3ac28ea962d2d..f2661c8d2d90037be13eaa667abcc3965a2f5c33 100644 (file)
@@ -9,7 +9,7 @@
 /* ----- START-EXPECTED-OUTPUT ----- */
 struct padded_implicitly {
        int a;
-       long int b;
+       long b;
        char c;
 };
 
index 8aaa24a003220bbf513b3bd3d751acbecb45d6c2..1c7105fcae3c4cd8983192854eeff3d27ccc1014 100644 (file)
@@ -189,7 +189,7 @@ struct struct_with_embedded_stuff {
                        const char *d;
                } e;
                union {
-                       volatile long int f;
+                       volatile long f;
                        void * restrict g;
                };
        };