staging: rtl8192u: remove redundant assignment to pointer crypt
[linux/fpc-iii.git] / tools / testing / selftests / bpf / progs / btf_dump_test_case_bitfields.c
blob8f44767a75fa5ffc5b91c6a5da1239127798a7fd
1 // SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause)
3 /*
4 * BTF-to-C dumper tests for bitfield.
6 * Copyright (c) 2019 Facebook
7 */
8 #include <stdbool.h>
10 /* ----- START-EXPECTED-OUTPUT ----- */
12 *struct bitfields_only_mixed_types {
13 * int a: 3;
14 * long int b: 2;
15 * _Bool c: 1;
16 * enum {
17 * A = 0,
18 * B = 1,
19 * } d: 1;
20 * short e: 5;
21 * int: 20;
22 * unsigned int f: 30;
23 *};
26 /* ------ END-EXPECTED-OUTPUT ------ */
28 struct bitfields_only_mixed_types {
29 int a: 3;
30 long int b: 2;
31 bool c: 1; /* it's really a _Bool type */
32 enum {
33 A, /* A = 0, dumper is very explicit */
34 B, /* B = 1, same */
35 } d: 1;
36 short e: 5;
37 /* 20-bit padding here */
38 unsigned f: 30; /* this gets aligned on 4-byte boundary */
41 /* ----- START-EXPECTED-OUTPUT ----- */
43 *struct bitfield_mixed_with_others {
44 * char: 4;
45 * int a: 4;
46 * short b;
47 * long int c;
48 * long int d: 8;
49 * int e;
50 * int f;
51 *};
54 /* ------ END-EXPECTED-OUTPUT ------ */
55 struct bitfield_mixed_with_others {
56 long: 4; /* char is enough as a backing field */
57 int a: 4;
58 /* 8-bit implicit padding */
59 short b; /* combined with previous bitfield */
60 /* 4 more bytes of implicit padding */
61 long c;
62 long d: 8;
63 /* 24 bits implicit padding */
64 int e; /* combined with previous bitfield */
65 int f;
66 /* 4 bytes of padding */
69 /* ----- START-EXPECTED-OUTPUT ----- */
71 *struct bitfield_flushed {
72 * int a: 4;
73 * long: 60;
74 * long int b: 16;
75 *};
78 /* ------ END-EXPECTED-OUTPUT ------ */
79 struct bitfield_flushed {
80 int a: 4;
81 long: 0; /* flush until next natural alignment boundary */
82 long b: 16;
85 int f(struct {
86 struct bitfields_only_mixed_types _1;
87 struct bitfield_mixed_with_others _2;
88 struct bitfield_flushed _3;
89 } *_)
91 return 0;