hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/tools/testing/selftests/bpf/progs/btf_dump_test_case_packing.c
....@@ -58,7 +58,81 @@
5858 } __attribute__((packed));
5959 };
6060
61
-/*------ END-EXPECTED-OUTPUT ------ */
61
+/* ----- START-EXPECTED-OUTPUT ----- */
62
+/*
63
+ *struct nested_packed_but_aligned_struct {
64
+ * int x1;
65
+ * int x2;
66
+ *};
67
+ *
68
+ *struct outer_implicitly_packed_struct {
69
+ * char y1;
70
+ * struct nested_packed_but_aligned_struct y2;
71
+ *} __attribute__((packed));
72
+ *
73
+ */
74
+/* ------ END-EXPECTED-OUTPUT ------ */
75
+
76
+struct nested_packed_but_aligned_struct {
77
+ int x1;
78
+ int x2;
79
+} __attribute__((packed));
80
+
81
+struct outer_implicitly_packed_struct {
82
+ char y1;
83
+ struct nested_packed_but_aligned_struct y2;
84
+};
85
+/* ----- START-EXPECTED-OUTPUT ----- */
86
+/*
87
+ *struct usb_ss_ep_comp_descriptor {
88
+ * char: 8;
89
+ * char bDescriptorType;
90
+ * char bMaxBurst;
91
+ * short wBytesPerInterval;
92
+ *};
93
+ *
94
+ *struct usb_host_endpoint {
95
+ * long: 64;
96
+ * char: 8;
97
+ * struct usb_ss_ep_comp_descriptor ss_ep_comp;
98
+ * long: 0;
99
+ *} __attribute__((packed));
100
+ *
101
+ */
102
+/* ------ END-EXPECTED-OUTPUT ------ */
103
+
104
+struct usb_ss_ep_comp_descriptor {
105
+ char: 8;
106
+ char bDescriptorType;
107
+ char bMaxBurst;
108
+ int: 0;
109
+ short wBytesPerInterval;
110
+} __attribute__((packed));
111
+
112
+struct usb_host_endpoint {
113
+ long: 64;
114
+ char: 8;
115
+ struct usb_ss_ep_comp_descriptor ss_ep_comp;
116
+ long: 0;
117
+};
118
+
119
+/* ----- START-EXPECTED-OUTPUT ----- */
120
+struct nested_packed_struct {
121
+ int a;
122
+ char b;
123
+} __attribute__((packed));
124
+
125
+struct outer_nonpacked_struct {
126
+ short a;
127
+ struct nested_packed_struct b;
128
+};
129
+
130
+struct outer_packed_struct {
131
+ short a;
132
+ struct nested_packed_struct b;
133
+} __attribute__((packed));
134
+
135
+/* ------ END-EXPECTED-OUTPUT ------ */
62136
63137 int f(struct {
64138 struct packed_trailing_space _1;
....@@ -69,6 +143,10 @@
69143 union union_is_never_packed _6;
70144 union union_does_not_need_packing _7;
71145 union jump_code_union _8;
146
+ struct outer_implicitly_packed_struct _9;
147
+ struct usb_host_endpoint _10;
148
+ struct outer_nonpacked_struct _11;
149
+ struct outer_packed_struct _12;
72150 } *_)
73151 {
74152 return 0;