libbpf: Fix btf_dump's packed struct determination
[platform/kernel/linux-starfive.git] / tools / testing / selftests / bpf / progs / btf_dump_test_case_packing.c
index 5c6c62f..7998f27 100644 (file)
@@ -116,6 +116,23 @@ struct usb_host_endpoint {
        long: 0;
 };
 
+/* ----- START-EXPECTED-OUTPUT ----- */
+struct nested_packed_struct {
+       int a;
+       char b;
+} __attribute__((packed));
+
+struct outer_nonpacked_struct {
+       short a;
+       struct nested_packed_struct b;
+};
+
+struct outer_packed_struct {
+       short a;
+       struct nested_packed_struct b;
+} __attribute__((packed));
+
+/* ------ END-EXPECTED-OUTPUT ------ */
 
 int f(struct {
        struct packed_trailing_space _1;
@@ -128,6 +145,8 @@ int f(struct {
        union jump_code_union _8;
        struct outer_implicitly_packed_struct _9;
        struct usb_host_endpoint _10;
+       struct outer_nonpacked_struct _11;
+       struct outer_packed_struct _12;
 } *_)
 {
        return 0;