mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 10:33:41 +02:00
selftests/bpf: Add non-standardly sized enum tests for btf_dump
Add few custom enum definitions testing mode(byte) and mode(word) attributes. Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Link: https://lore.kernel.org/bpf/20221212211505.558851-4-andrii@kernel.org
This commit is contained in:
parent
21a9a1bccc
commit
9d2349740e
|
|
@ -25,6 +25,39 @@ typedef enum {
|
|||
H = 2,
|
||||
} e3_t;
|
||||
|
||||
/* ----- START-EXPECTED-OUTPUT ----- */
|
||||
/*
|
||||
*enum e_byte {
|
||||
* EBYTE_1 = 0,
|
||||
* EBYTE_2 = 1,
|
||||
*} __attribute__((mode(byte)));
|
||||
*
|
||||
*/
|
||||
/* ----- END-EXPECTED-OUTPUT ----- */
|
||||
enum e_byte {
|
||||
EBYTE_1,
|
||||
EBYTE_2,
|
||||
} __attribute__((mode(byte)));
|
||||
|
||||
/* ----- START-EXPECTED-OUTPUT ----- */
|
||||
/*
|
||||
*enum e_word {
|
||||
* EWORD_1 = 0LL,
|
||||
* EWORD_2 = 1LL,
|
||||
*} __attribute__((mode(word)));
|
||||
*
|
||||
*/
|
||||
/* ----- END-EXPECTED-OUTPUT ----- */
|
||||
enum e_word {
|
||||
EWORD_1,
|
||||
EWORD_2,
|
||||
} __attribute__((mode(word))); /* force to use 8-byte backing for this enum */
|
||||
|
||||
/* ----- START-EXPECTED-OUTPUT ----- */
|
||||
enum e_big {
|
||||
EBIG_1 = 1000000000000ULL,
|
||||
};
|
||||
|
||||
typedef int int_t;
|
||||
|
||||
typedef volatile const int * volatile const crazy_ptr_t;
|
||||
|
|
@ -224,6 +257,9 @@ struct root_struct {
|
|||
enum e2 _2;
|
||||
e2_t _2_1;
|
||||
e3_t _2_2;
|
||||
enum e_byte _100;
|
||||
enum e_word _101;
|
||||
enum e_big _102;
|
||||
struct struct_w_typedefs _3;
|
||||
anon_struct_t _7;
|
||||
struct struct_fwd *_8;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user