Lines Matching refs:btf2
9 struct btf *btf1, *btf2; in test_split_simple() local
36 btf2 = btf__new_empty_split(btf1); in test_split_simple()
37 if (!ASSERT_OK_PTR(btf2, "empty_split_btf")) in test_split_simple()
41 ASSERT_EQ(btf__pointer_size(btf2), 8, "inherit_ptr_sz"); in test_split_simple()
43 str_off = btf__find_str(btf2, "int"); in test_split_simple()
46 t = btf__type_by_id(btf2, 1); in test_split_simple()
50 ASSERT_STREQ(btf__str_by_offset(btf2, t->name_off), "int", "int_name"); in test_split_simple()
52 btf__add_struct(btf2, "s2", 16); /* [4] struct s2 { */ in test_split_simple()
53 btf__add_field(btf2, "f1", 6, 0, 0); /* struct s1 f1; */ in test_split_simple()
54 btf__add_field(btf2, "f2", 5, 32, 0); /* int f2; */ in test_split_simple()
55 btf__add_field(btf2, "f3", 2, 64, 0); /* int *f3; */ in test_split_simple()
59 btf__add_int(btf2, "int", 4, BTF_INT_SIGNED); /* [5] int */ in test_split_simple()
62 btf__add_struct(btf2, "s1", 4); /* [6] struct s1 { */ in test_split_simple()
63 btf__add_field(btf2, "f1", 5, 0, 0); /* int f1; */ in test_split_simple()
67 btf2, in test_split_simple()
80 ASSERT_STREQ(btf_type_c_dump(btf2), "\ in test_split_simple()
95 err = btf__dedup(btf2, NULL); in test_split_simple()
100 btf2, in test_split_simple()
110 ASSERT_STREQ(btf_type_c_dump(btf2), "\ in test_split_simple()
122 btf__free(btf2); in test_split_simple()
127 struct btf *btf1, *btf2; in test_split_fwd_resolve() local
164 btf2 = btf__new_empty_split(btf1); in test_split_fwd_resolve()
165 if (!ASSERT_OK_PTR(btf2, "empty_split_btf")) in test_split_fwd_resolve()
168 btf__add_int(btf2, "int", 4, BTF_INT_SIGNED); /* [7] int */ in test_split_fwd_resolve()
169 btf__add_ptr(btf2, 11); /* [8] ptr to struct s1 */ in test_split_fwd_resolve()
170 btf__add_fwd(btf2, "s2", BTF_FWD_STRUCT); /* [9] fwd for struct s2 */ in test_split_fwd_resolve()
171 btf__add_ptr(btf2, 9); /* [10] ptr to fwd struct s2 */ in test_split_fwd_resolve()
172 btf__add_struct(btf2, "s1", 16); /* [11] struct s1 { */ in test_split_fwd_resolve()
173 btf__add_field(btf2, "f1", 8, 0, 0); /* struct s1 *f1; */ in test_split_fwd_resolve()
174 btf__add_field(btf2, "f2", 10, 64, 0); /* struct s2 *f2; */ in test_split_fwd_resolve()
176 btf__add_fwd(btf2, "s3", BTF_FWD_STRUCT); /* [12] fwd for struct s3 */ in test_split_fwd_resolve()
177 btf__add_ptr(btf2, 12); /* [13] ptr to struct s1 */ in test_split_fwd_resolve()
180 btf2, in test_split_fwd_resolve()
201 err = btf__dedup(btf2, NULL); in test_split_fwd_resolve()
206 btf2, in test_split_fwd_resolve()
220 btf__free(btf2); in test_split_fwd_resolve()
225 struct btf *btf1, *btf2; in test_split_struct_duped() local
253 btf2 = btf__new_empty_split(btf1); in test_split_struct_duped()
254 if (!ASSERT_OK_PTR(btf2, "empty_split_btf")) in test_split_struct_duped()
257 btf__add_int(btf2, "int", 4, BTF_INT_SIGNED); /* [6] int */ in test_split_struct_duped()
258 btf__add_ptr(btf2, 10); /* [7] ptr to struct s1 */ in test_split_struct_duped()
259 btf__add_fwd(btf2, "s2", BTF_FWD_STRUCT); /* [8] fwd for struct s2 */ in test_split_struct_duped()
260 btf__add_ptr(btf2, 11); /* [9] ptr to struct s2 */ in test_split_struct_duped()
261 btf__add_struct(btf2, "s1", 16); /* [10] struct s1 { */ in test_split_struct_duped()
262 btf__add_field(btf2, "f1", 7, 0, 0); /* struct s1 *f1; */ in test_split_struct_duped()
263 btf__add_field(btf2, "f2", 9, 64, 0); /* struct s2 *f2; */ in test_split_struct_duped()
265 btf__add_struct(btf2, "s2", 40); /* [11] struct s2 { */ in test_split_struct_duped()
266 btf__add_field(btf2, "f1", 7, 0, 0); /* struct s1 *f1; */ in test_split_struct_duped()
267 btf__add_field(btf2, "f2", 9, 64, 0); /* struct s2 *f2; */ in test_split_struct_duped()
268 btf__add_field(btf2, "f3", 6, 128, 0); /* int f3; */ in test_split_struct_duped()
269 btf__add_field(btf2, "f4", 10, 192, 0); /* struct s1 f4; */ in test_split_struct_duped()
271 btf__add_ptr(btf2, 8); /* [12] ptr to fwd struct s2 */ in test_split_struct_duped()
272 btf__add_struct(btf2, "s3", 8); /* [13] struct s3 { */ in test_split_struct_duped()
273 btf__add_field(btf2, "f1", 12, 0, 0); /* struct s2 *f1; (fwd) */ in test_split_struct_duped()
277 btf2, in test_split_struct_duped()
301 err = btf__dedup(btf2, NULL); in test_split_struct_duped()
306 btf2, in test_split_struct_duped()
328 btf__free(btf2); in test_split_struct_duped()
358 struct btf *btf1, *btf2 = NULL; in test_split_dup_struct_in_cu() local
397 btf2 = btf__new_empty_split(btf1); in test_split_dup_struct_in_cu()
398 if (!ASSERT_OK_PTR(btf2, "empty_split_btf")) in test_split_dup_struct_in_cu()
401 btf_add_dup_struct_in_cu(btf2, 3); in test_split_dup_struct_in_cu()
404 btf2, in test_split_dup_struct_in_cu()
423 err = btf__dedup(btf2, NULL); in test_split_dup_struct_in_cu()
429 btf2, in test_split_dup_struct_in_cu()
439 btf__free(btf2); in test_split_dup_struct_in_cu()