llcppsigfetch:simpilfy func test

This commit is contained in:
luoliwoshang
2024-08-22 12:11:53 +08:00
parent 1557a76225
commit 0a8e25b405
2 changed files with 20 additions and 68 deletions

View File

@@ -11,13 +11,13 @@ func TestFuncDecl() {
`void foo();`, `void foo();`,
`void foo(int a);`, `void foo(int a);`,
`float foo(int a,double b);`, `float foo(int a,double b);`,
`float* foo(int a,double b);`,
`void foo(char* str, double x);`, `void foo(char* str);`,
`float* foo(char* str, double x);`, `void* foo(char*** str);`,
`float* foo(char*** str, double x);`,
`float* foo(char str[], double x);`, `void foo(char str[]);`,
`float* foo(int arr[3][4]);`, `void foo(int arr[3][4]);`,
} }
test.RunTest("TestFuncDecl", testCases) test.RunTest("TestFuncDecl", testCases)
} }

View File

@@ -146,10 +146,8 @@ TestFuncDecl Case 4:
"Params": { "Params": {
"List": [{ "List": [{
"Type": { "Type": {
"X": { "Kind": 6,
"Kind": 2, "Flags": 0
"Flags": 1
}
}, },
"Doc": { "Doc": {
"List": [] "List": []
@@ -158,7 +156,7 @@ TestFuncDecl Case 4:
"List": [] "List": []
}, },
"Names": [{ "Names": [{
"Name": "str" "Name": "a"
}] }]
}, { }, {
"Type": { "Type": {
@@ -172,13 +170,15 @@ TestFuncDecl Case 4:
"List": [] "List": []
}, },
"Names": [{ "Names": [{
"Name": "x" "Name": "b"
}] }]
}] }]
}, },
"Ret": { "Ret": {
"Kind": 0, "X": {
"Flags": 0 "Kind": 8,
"Flags": 0
}
} }
} }
}], }],
@@ -219,27 +219,11 @@ TestFuncDecl Case 5:
"Names": [{ "Names": [{
"Name": "str" "Name": "str"
}] }]
}, {
"Type": {
"Kind": 8,
"Flags": 16
},
"Doc": {
"List": []
},
"Comment": {
"List": []
},
"Names": [{
"Name": "x"
}]
}] }]
}, },
"Ret": { "Ret": {
"X": { "Kind": 0,
"Kind": 8, "Flags": 0
"Flags": 0
}
} }
} }
}], }],
@@ -284,25 +268,11 @@ TestFuncDecl Case 6:
"Names": [{ "Names": [{
"Name": "str" "Name": "str"
}] }]
}, {
"Type": {
"Kind": 8,
"Flags": 16
},
"Doc": {
"List": []
},
"Comment": {
"List": []
},
"Names": [{
"Name": "x"
}]
}] }]
}, },
"Ret": { "Ret": {
"X": { "X": {
"Kind": 8, "Kind": 0,
"Flags": 0 "Flags": 0
} }
} }
@@ -346,27 +316,11 @@ TestFuncDecl Case 7:
"Names": [{ "Names": [{
"Name": "str" "Name": "str"
}] }]
}, {
"Type": {
"Kind": 8,
"Flags": 16
},
"Doc": {
"List": []
},
"Comment": {
"List": []
},
"Names": [{
"Name": "x"
}]
}] }]
}, },
"Ret": { "Ret": {
"X": { "Kind": 0,
"Kind": 8, "Flags": 0
"Flags": 0
}
} }
} }
}], }],
@@ -420,10 +374,8 @@ TestFuncDecl Case 8:
}] }]
}, },
"Ret": { "Ret": {
"X": { "Kind": 0,
"Kind": 8, "Flags": 0
"Flags": 0
}
} }
} }
}], }],