github.com/jxskiss/gopkg/v2@v2.14.9-0.20240514120614-899f3e7952b4/internal/linkname/reflect_test.go (about)

     1  package linkname
     2  
     3  func compileReflectFunctions() {
     4  	call(Reflect_typelinks)
     5  	call(Reflect_resolveTypeOff)
     6  	call(Reflect_rtype_Align)
     7  	call(Reflect_rtype_FieldAlign)
     8  	call(Reflect_rtype_Method)
     9  	call(Reflect_rtype_MethodByName)
    10  	call(Reflect_rtype_NumMethod)
    11  	call(Reflect_rtype_Name)
    12  	call(Reflect_rtype_PkgPath)
    13  	call(Reflect_rtype_Size)
    14  	call(Reflect_rtype_String)
    15  	call(Reflect_rtype_Kind)
    16  	call(Reflect_rtype_Implements)
    17  	call(Reflect_rtype_AssignableTo)
    18  	call(Reflect_rtype_ConvertibleTo)
    19  	call(Reflect_rtype_Comparable)
    20  	call(Reflect_rtype_Bits)
    21  	call(Reflect_rtype_ChanDir)
    22  	call(Reflect_rtype_IsVariadic)
    23  	call(Reflect_rtype_Elem)
    24  	call(Reflect_rtype_Field)
    25  	call(Reflect_rtype_FieldByIndex)
    26  	call(Reflect_rtype_FieldByName)
    27  	call(Reflect_rtype_FieldByNameFunc)
    28  	call(Reflect_rtype_In)
    29  	call(Reflect_rtype_Key)
    30  	call(Reflect_rtype_Len)
    31  	call(Reflect_rtype_NumField)
    32  	call(Reflect_rtype_NumIn)
    33  	call(Reflect_rtype_NumOut)
    34  	call(Reflect_rtype_Out)
    35  	call(Reflect_ifaceIndir)
    36  	call(Reflect_unsafe_New)
    37  	call(Reflect_unsafe_NewArray)
    38  	call(Reflect_typedmemmove)
    39  	call(Reflect_typedslicecopy)
    40  	call(Reflect_maplen)
    41  }
    42  
    43  var reflectSourceCode = []SourceCodeTestCase{
    44  	{
    45  		MaxVer:   newVer(1, 20, 999),
    46  		FileName: "reflect/type.go",
    47  		Lines: []string{
    48  			"func (t *rtype) common() *rtype { return t }",
    49  			"func typelinks() (sections []unsafe.Pointer, offset [][]int32)",
    50  			"func resolveTypeOff(rtype unsafe.Pointer, off int32) unsafe.Pointer",
    51  			"func ifaceIndir(t *rtype) bool",
    52  		},
    53  	},
    54  	{
    55  		MinVer:   newVer(1, 21, 0),
    56  		FileName: "reflect/type.go",
    57  		Lines: []string{
    58  			"func (t *rtype) common() *abi.Type",
    59  			"func typelinks() (sections []unsafe.Pointer, offset [][]int32)",
    60  			"func resolveTypeOff(rtype unsafe.Pointer, off int32) unsafe.Pointer",
    61  			"func ifaceIndir(t *abi.Type) bool",
    62  		},
    63  	},
    64  	{
    65  		MaxVer:   newVer(1, 20, 999),
    66  		FileName: "reflect/value.go",
    67  		Lines: []string{
    68  			"func unsafe_New(*rtype) unsafe.Pointer",
    69  			"func unsafe_NewArray(*rtype, int) unsafe.Pointer",
    70  			"func typedmemmove(t *rtype, dst, src unsafe.Pointer)",
    71  			"func typedslicecopy(elemType *rtype, dst, src unsafeheader.Slice) int",
    72  			"func maplen(m unsafe.Pointer) int",
    73  		},
    74  	},
    75  	{
    76  		MinVer:   newVer(1, 21, 0),
    77  		FileName: "reflect/value.go",
    78  		Lines: []string{
    79  			"func unsafe_New(*abi.Type) unsafe.Pointer",
    80  			"func unsafe_NewArray(*abi.Type, int) unsafe.Pointer",
    81  			"func typedmemmove(t *abi.Type, dst, src unsafe.Pointer)",
    82  			"func typedslicecopy(t *abi.Type, dst, src unsafeheader.Slice) int",
    83  			"func maplen(m unsafe.Pointer) int",
    84  		},
    85  	},
    86  }