llcppsigfetch:variadic param

This commit is contained in:
luoliwoshang
2024-08-27 16:18:29 +08:00
parent e57ee17532
commit 0ac48369fe
6 changed files with 115 additions and 34 deletions

View File

@@ -10,6 +10,7 @@ func TestFuncDecl() {
testCases := []string{
`void foo();`,
`void foo(int a);`,
`void foo(int a,...);`,
`float* foo(int a,double b);`,
`static inline int add(int a, int b);`,
}

View File

@@ -88,6 +88,63 @@ TestFuncDecl Case 2:
}
TestFuncDecl Case 3:
{
"temp.h": {
"decls": [{
"Loc": {
"File": "temp.h"
},
"Doc": {
"List": []
},
"Parent": null,
"Name": {
"Name": "foo"
},
"Type": {
"Params": {
"List": [{
"Type": {
},
"Doc": null,
"Comment": null,
"Names": []
}, {
"Type": {
"Kind": 6,
"Flags": 0
},
"Doc": {
"List": []
},
"Comment": {
"List": []
},
"Names": [{
"Name": "a"
}]
}]
},
"Ret": {
"Kind": 0,
"Flags": 0
}
},
"IsInline": false,
"IsStatic": false,
"IsConst": false,
"IsExplicit": false,
"IsConstructor": false,
"IsDestructor": false,
"IsVirtual": false,
"IsOverride": false
}],
"includes": [],
"macros": []
}
}
TestFuncDecl Case 4:
{
"temp.h": {
"decls": [{
@@ -154,7 +211,7 @@ TestFuncDecl Case 3:
}
}
TestFuncDecl Case 4:
TestFuncDecl Case 5:
{
"temp.h": {
"decls": [{

View File

@@ -94,6 +94,12 @@ TestTypeDefDecl Case 3:
"Doc": null,
"Comment": null,
"Names": []
}, {
"Type": {
},
"Doc": null,
"Comment": null,
"Names": []
}]
},
"Ret": {

View File

@@ -13,7 +13,7 @@ func TestTypeDefDecl() {
`typedef int INT;
typedef INT STANDARD_INT;`,
`typedef int (*Foo)(int, int);`,
`typedef int (*Foo)(int, int, ...);`,
}
test.RunTest("TestTypeDefDecl", testCases)
}