@@ -3903,6 +3903,42 @@ static struct btf_raw_test raw_tests[] = {
39033903 .btf_load_err = true,
39043904 .err_str = "Invalid component_idx" ,
39053905},
3906+ {
3907+ .descr = "decl_tag test #13, typedef, well-formed" ,
3908+ .raw_types = {
3909+ BTF_TYPE_INT_ENC (0 , BTF_INT_SIGNED , 0 , 32 , 4 ), /* [1] */
3910+ BTF_TYPEDEF_ENC (NAME_TBD , 1 ), /* [2] */
3911+ BTF_DECL_TAG_ENC (NAME_TBD , 2 , -1 ),
3912+ BTF_END_RAW ,
3913+ },
3914+ BTF_STR_SEC ("\0t\0tag" ),
3915+ .map_type = BPF_MAP_TYPE_ARRAY ,
3916+ .map_name = "tag_type_check_btf" ,
3917+ .key_size = sizeof (int ),
3918+ .value_size = 4 ,
3919+ .key_type_id = 1 ,
3920+ .value_type_id = 1 ,
3921+ .max_entries = 1 ,
3922+ },
3923+ {
3924+ .descr = "decl_tag test #14, typedef, invalid component_idx" ,
3925+ .raw_types = {
3926+ BTF_TYPE_INT_ENC (0 , BTF_INT_SIGNED , 0 , 32 , 4 ), /* [1] */
3927+ BTF_TYPEDEF_ENC (NAME_TBD , 1 ), /* [2] */
3928+ BTF_DECL_TAG_ENC (NAME_TBD , 2 , 0 ),
3929+ BTF_END_RAW ,
3930+ },
3931+ BTF_STR_SEC ("\0local\0tag" ),
3932+ .map_type = BPF_MAP_TYPE_ARRAY ,
3933+ .map_name = "tag_type_check_btf" ,
3934+ .key_size = sizeof (int ),
3935+ .value_size = 4 ,
3936+ .key_type_id = 1 ,
3937+ .value_type_id = 1 ,
3938+ .max_entries = 1 ,
3939+ .btf_load_err = true,
3940+ .err_str = "Invalid component_idx" ,
3941+ },
39063942
39073943}; /* struct btf_raw_test raw_tests[] */
39083944
0 commit comments