1 // SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause)
4 * BTF-to-C dumper tests for struct packing determination.
6 * Copyright (c) 2019 Facebook
8 /* ----- START-EXPECTED-OUTPUT ----- */
9 struct packed_trailing_space {
12 } __attribute__((packed));
14 struct non_packed_trailing_space {
19 struct packed_fields {
22 } __attribute__((packed));
24 struct non_packed_fields {
29 struct nested_packed {
36 } __attribute__((packed)) e;
37 } __attribute__((packed));
39 union union_is_never_packed {
45 union union_does_not_need_packing {
49 } __attribute__((packed));
53 union jump_code_union {
58 } __attribute__((packed));
61 /* ----- START-EXPECTED-OUTPUT ----- */
63 *struct nested_packed_but_aligned_struct {
68 *struct outer_implicitly_packed_struct {
70 * struct nested_packed_but_aligned_struct y2;
71 *} __attribute__((packed));
74 /* ------ END-EXPECTED-OUTPUT ------ */
76 struct nested_packed_but_aligned_struct {
79 } __attribute__((packed));
81 struct outer_implicitly_packed_struct {
83 struct nested_packed_but_aligned_struct y2;
85 /* ----- START-EXPECTED-OUTPUT ----- */
87 *struct usb_ss_ep_comp_descriptor {
89 * char bDescriptorType;
91 * short wBytesPerInterval;
94 *struct usb_host_endpoint {
97 * struct usb_ss_ep_comp_descriptor ss_ep_comp;
99 *} __attribute__((packed));
102 /* ------ END-EXPECTED-OUTPUT ------ */
104 struct usb_ss_ep_comp_descriptor {
106 char bDescriptorType;
109 short wBytesPerInterval;
110 } __attribute__((packed));
112 struct usb_host_endpoint {
115 struct usb_ss_ep_comp_descriptor ss_ep_comp;
119 /* ----- START-EXPECTED-OUTPUT ----- */
120 struct nested_packed_struct {
123 } __attribute__((packed));
125 struct outer_nonpacked_struct {
127 struct nested_packed_struct b;
130 struct outer_packed_struct {
132 struct nested_packed_struct b;
133 } __attribute__((packed));
135 /* ------ END-EXPECTED-OUTPUT ------ */
138 struct packed_trailing_space _1;
139 struct non_packed_trailing_space _2;
140 struct packed_fields _3;
141 struct non_packed_fields _4;
142 struct nested_packed _5;
143 union union_is_never_packed _6;
144 union union_does_not_need_packing _7;
145 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;