@@ -3903,6 +3903,42 @@ static struct btf_raw_test raw_tests[] = {
3903
3903
.btf_load_err = true,
3904
3904
.err_str = "Invalid component_idx" ,
3905
3905
},
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
+ },
3906
3942
3907
3943
}; /* struct btf_raw_test raw_tests[] */
3908
3944
0 commit comments