Lines Matching full:t
10 const struct btf_type *t; in test_btf_write() local
34 t = btf__type_by_id(btf, 1); in test_btf_write()
36 ASSERT_EQ(t->name_off, str_off, "int_name_off"); in test_btf_write()
37 ASSERT_STREQ(btf__str_by_offset(btf, t->name_off), "int", "int_name"); in test_btf_write()
38 ASSERT_EQ(btf_kind(t), BTF_KIND_INT, "int_kind"); in test_btf_write()
39 ASSERT_EQ(t->size, 4, "int_sz"); in test_btf_write()
40 ASSERT_EQ(btf_int_encoding(t), BTF_INT_SIGNED, "int_enc"); in test_btf_write()
41 ASSERT_EQ(btf_int_bits(t), 32, "int_bits"); in test_btf_write()
59 t = btf__type_by_id(btf, 2); in test_btf_write()
60 ASSERT_EQ(btf_kind(t), BTF_KIND_PTR, "ptr_kind"); in test_btf_write()
61 ASSERT_EQ(t->type, 1, "ptr_type"); in test_btf_write()
65 t = btf__type_by_id(btf, 3); in test_btf_write()
66 ASSERT_EQ(btf_kind(t), BTF_KIND_CONST, "const_kind"); in test_btf_write()
67 ASSERT_EQ(t->type, 5, "const_type"); in test_btf_write()
71 t = btf__type_by_id(btf, 4); in test_btf_write()
72 ASSERT_EQ(btf_kind(t), BTF_KIND_VOLATILE, "volatile_kind"); in test_btf_write()
73 ASSERT_EQ(t->type, 3, "volatile_type"); in test_btf_write()
77 t = btf__type_by_id(btf, 5); in test_btf_write()
78 ASSERT_EQ(btf_kind(t), BTF_KIND_RESTRICT, "restrict_kind"); in test_btf_write()
79 ASSERT_EQ(t->type, 4, "restrict_type"); in test_btf_write()
84 t = btf__type_by_id(btf, 6); in test_btf_write()
85 ASSERT_EQ(btf_kind(t), BTF_KIND_ARRAY, "array_kind"); in test_btf_write()
86 ASSERT_EQ(btf_array(t)->index_type, 1, "array_index_type"); in test_btf_write()
87 ASSERT_EQ(btf_array(t)->type, 2, "array_elem_type"); in test_btf_write()
88 ASSERT_EQ(btf_array(t)->nelems, 10, "array_nelems"); in test_btf_write()
100 t = btf__type_by_id(btf, 7); in test_btf_write()
101 ASSERT_STREQ(btf__str_by_offset(btf, t->name_off), "s1", "struct_name"); in test_btf_write()
102 ASSERT_EQ(btf_kind(t), BTF_KIND_STRUCT, "struct_kind"); in test_btf_write()
103 ASSERT_EQ(btf_vlen(t), 2, "struct_vlen"); in test_btf_write()
104 ASSERT_EQ(btf_kflag(t), true, "struct_kflag"); in test_btf_write()
105 ASSERT_EQ(t->size, 8, "struct_sz"); in test_btf_write()
106 m = btf_members(t) + 0; in test_btf_write()
109 ASSERT_EQ(btf_member_bit_offset(t, 0), 0, "f1_bit_off"); in test_btf_write()
110 ASSERT_EQ(btf_member_bitfield_size(t, 0), 0, "f1_bit_sz"); in test_btf_write()
111 m = btf_members(t) + 1; in test_btf_write()
114 ASSERT_EQ(btf_member_bit_offset(t, 1), 32, "f2_bit_off"); in test_btf_write()
115 ASSERT_EQ(btf_member_bitfield_size(t, 1), 16, "f2_bit_sz"); in test_btf_write()
128 t = btf__type_by_id(btf, 8); in test_btf_write()
129 ASSERT_STREQ(btf__str_by_offset(btf, t->name_off), "u1", "union_name"); in test_btf_write()
130 ASSERT_EQ(btf_kind(t), BTF_KIND_UNION, "union_kind"); in test_btf_write()
131 ASSERT_EQ(btf_vlen(t), 1, "union_vlen"); in test_btf_write()
132 ASSERT_EQ(btf_kflag(t), true, "union_kflag"); in test_btf_write()
133 ASSERT_EQ(t->size, 8, "union_sz"); in test_btf_write()
134 m = btf_members(t) + 0; in test_btf_write()
137 ASSERT_EQ(btf_member_bit_offset(t, 0), 0, "f1_bit_off"); in test_btf_write()
138 ASSERT_EQ(btf_member_bitfield_size(t, 0), 16, "f1_bit_sz"); in test_btf_write()
148 t = btf__type_by_id(btf, 9); in test_btf_write()
149 ASSERT_STREQ(btf__str_by_offset(btf, t->name_off), "e1", "enum_name"); in test_btf_write()
150 ASSERT_EQ(btf_kind(t), BTF_KIND_ENUM, "enum_kind"); in test_btf_write()
151 ASSERT_EQ(btf_vlen(t), 2, "enum_vlen"); in test_btf_write()
152 ASSERT_EQ(t->size, 4, "enum_sz"); in test_btf_write()
153 v = btf_enum(t) + 0; in test_btf_write()
156 v = btf_enum(t) + 1; in test_btf_write()
163 t = btf__type_by_id(btf, 10); in test_btf_write()
164 ASSERT_STREQ(btf__str_by_offset(btf, t->name_off), "struct_fwd", "fwd_name"); in test_btf_write()
165 ASSERT_EQ(btf_kind(t), BTF_KIND_FWD, "fwd_kind"); in test_btf_write()
166 ASSERT_EQ(btf_kflag(t), 0, "fwd_kflag"); in test_btf_write()
170 t = btf__type_by_id(btf, 11); in test_btf_write()
171 ASSERT_STREQ(btf__str_by_offset(btf, t->name_off), "union_fwd", "fwd_name"); in test_btf_write()
172 ASSERT_EQ(btf_kind(t), BTF_KIND_FWD, "fwd_kind"); in test_btf_write()
173 ASSERT_EQ(btf_kflag(t), 1, "fwd_kflag"); in test_btf_write()
177 t = btf__type_by_id(btf, 12); in test_btf_write()
178 ASSERT_STREQ(btf__str_by_offset(btf, t->name_off), "enum_fwd", "fwd_name"); in test_btf_write()
179 ASSERT_EQ(btf_kind(t), BTF_KIND_ENUM, "enum_fwd_kind"); in test_btf_write()
180 ASSERT_EQ(btf_vlen(t), 0, "enum_fwd_kind"); in test_btf_write()
181 ASSERT_EQ(t->size, 4, "enum_fwd_sz"); in test_btf_write()
186 t = btf__type_by_id(btf, 13); in test_btf_write()
187 ASSERT_STREQ(btf__str_by_offset(btf, t->name_off), "typedef1", "typedef_name"); in test_btf_write()
188 ASSERT_EQ(btf_kind(t), BTF_KIND_TYPEDEF, "typedef_kind"); in test_btf_write()
189 ASSERT_EQ(t->type, 1, "typedef_type"); in test_btf_write()
194 t = btf__type_by_id(btf, 14); in test_btf_write()
195 ASSERT_STREQ(btf__str_by_offset(btf, t->name_off), "func1", "func_name"); in test_btf_write()
196 ASSERT_EQ(t->type, 15, "func_type"); in test_btf_write()
197 ASSERT_EQ(btf_kind(t), BTF_KIND_FUNC, "func_kind"); in test_btf_write()
198 ASSERT_EQ(btf_vlen(t), BTF_FUNC_GLOBAL, "func_vlen"); in test_btf_write()
207 t = btf__type_by_id(btf, 15); in test_btf_write()
208 ASSERT_EQ(btf_kind(t), BTF_KIND_FUNC_PROTO, "func_proto_kind"); in test_btf_write()
209 ASSERT_EQ(btf_vlen(t), 2, "func_proto_vlen"); in test_btf_write()
210 ASSERT_EQ(t->type, 1, "func_proto_ret_type"); in test_btf_write()
211 p = btf_params(t) + 0; in test_btf_write()
214 p = btf_params(t) + 1; in test_btf_write()
221 t = btf__type_by_id(btf, 16); in test_btf_write()
222 ASSERT_STREQ(btf__str_by_offset(btf, t->name_off), "var1", "var_name"); in test_btf_write()
223 ASSERT_EQ(btf_kind(t), BTF_KIND_VAR, "var_kind"); in test_btf_write()
224 ASSERT_EQ(t->type, 1, "var_type"); in test_btf_write()
225 ASSERT_EQ(btf_var(t)->linkage, BTF_VAR_GLOBAL_ALLOCATED, "var_type"); in test_btf_write()
233 t = btf__type_by_id(btf, 17); in test_btf_write()
234 ASSERT_STREQ(btf__str_by_offset(btf, t->name_off), "datasec1", "datasec_name"); in test_btf_write()
235 ASSERT_EQ(t->size, 12, "datasec_sz"); in test_btf_write()
236 ASSERT_EQ(btf_kind(t), BTF_KIND_DATASEC, "datasec_kind"); in test_btf_write()
237 ASSERT_EQ(btf_vlen(t), 1, "datasec_vlen"); in test_btf_write()
238 vi = btf_var_secinfos(t) + 0; in test_btf_write()