llcppsigfetch:func pointer
This commit is contained in:
@@ -148,6 +148,84 @@ TestStructDecl Case 3:
|
||||
}
|
||||
}
|
||||
|
||||
TestStructDecl Case 4:
|
||||
{
|
||||
"temp.h": {
|
||||
"decls": [{
|
||||
"Loc": {
|
||||
"File": "temp.h"
|
||||
},
|
||||
"Doc": {
|
||||
"List": []
|
||||
},
|
||||
"Parent": null,
|
||||
"Name": {
|
||||
"Name": "A"
|
||||
},
|
||||
"Type": {
|
||||
"Tag": 0,
|
||||
"Fields": {
|
||||
"List": [{
|
||||
"Type": {
|
||||
"Kind": 6,
|
||||
"Flags": 0
|
||||
},
|
||||
"Doc": {
|
||||
"List": []
|
||||
},
|
||||
"Comment": {
|
||||
"List": []
|
||||
},
|
||||
"Names": [{
|
||||
"Name": "a"
|
||||
}]
|
||||
}, {
|
||||
"Type": {
|
||||
"X": {
|
||||
"Params": {
|
||||
"List": [{
|
||||
"Type": {
|
||||
"Kind": 6,
|
||||
"Flags": 0
|
||||
},
|
||||
"Doc": null,
|
||||
"Comment": null,
|
||||
"Names": []
|
||||
}, {
|
||||
"Type": {
|
||||
"Kind": 6,
|
||||
"Flags": 0
|
||||
},
|
||||
"Doc": null,
|
||||
"Comment": null,
|
||||
"Names": []
|
||||
}]
|
||||
},
|
||||
"Ret": {
|
||||
"Kind": 6,
|
||||
"Flags": 0
|
||||
}
|
||||
}
|
||||
},
|
||||
"Doc": {
|
||||
"List": []
|
||||
},
|
||||
"Comment": {
|
||||
"List": []
|
||||
},
|
||||
"Names": [{
|
||||
"Name": "Foo"
|
||||
}]
|
||||
}]
|
||||
},
|
||||
"Methods": []
|
||||
}
|
||||
}],
|
||||
"includes": [],
|
||||
"macros": []
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#stderr
|
||||
|
||||
|
||||
@@ -18,6 +18,10 @@ func TestStructDecl() {
|
||||
`struct A {
|
||||
int a, b;
|
||||
};`,
|
||||
`struct A {
|
||||
int a;
|
||||
int (*Foo)(int, int);
|
||||
};`,
|
||||
}
|
||||
test.RunTest("TestStructDecl", testCases)
|
||||
}
|
||||
|
||||
@@ -61,6 +61,53 @@ TestTypeDefDecl Case 2:
|
||||
}
|
||||
}
|
||||
|
||||
TestTypeDefDecl Case 3:
|
||||
{
|
||||
"temp.h": {
|
||||
"decls": [{
|
||||
"Loc": {
|
||||
"File": "temp.h"
|
||||
},
|
||||
"Doc": {
|
||||
"List": []
|
||||
},
|
||||
"Parent": null,
|
||||
"Name": {
|
||||
"Name": "Foo"
|
||||
},
|
||||
"Type": {
|
||||
"X": {
|
||||
"Params": {
|
||||
"List": [{
|
||||
"Type": {
|
||||
"Kind": 6,
|
||||
"Flags": 0
|
||||
},
|
||||
"Doc": null,
|
||||
"Comment": null,
|
||||
"Names": []
|
||||
}, {
|
||||
"Type": {
|
||||
"Kind": 6,
|
||||
"Flags": 0
|
||||
},
|
||||
"Doc": null,
|
||||
"Comment": null,
|
||||
"Names": []
|
||||
}]
|
||||
},
|
||||
"Ret": {
|
||||
"Kind": 6,
|
||||
"Flags": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}],
|
||||
"includes": [],
|
||||
"macros": []
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#stderr
|
||||
|
||||
|
||||
@@ -12,6 +12,8 @@ func TestTypeDefDecl() {
|
||||
|
||||
`typedef int INT;
|
||||
typedef INT STANDARD_INT;`,
|
||||
|
||||
`typedef int (*Foo)(int, int);`,
|
||||
}
|
||||
test.RunTest("TestTypeDefDecl", testCases)
|
||||
}
|
||||
|
||||
@@ -169,6 +169,34 @@ Type: class a::b::c:
|
||||
},
|
||||
"Tag": 3
|
||||
}
|
||||
Type: int (*)(int, char):
|
||||
{
|
||||
"X": {
|
||||
"Params": {
|
||||
"List": [{
|
||||
"Type": {
|
||||
"Kind": 6,
|
||||
"Flags": 0
|
||||
},
|
||||
"Doc": null,
|
||||
"Comment": null,
|
||||
"Names": []
|
||||
}, {
|
||||
"Type": {
|
||||
"Kind": 2,
|
||||
"Flags": 1
|
||||
},
|
||||
"Doc": null,
|
||||
"Comment": null,
|
||||
"Names": []
|
||||
}]
|
||||
},
|
||||
"Ret": {
|
||||
"Kind": 6,
|
||||
"Flags": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#stderr
|
||||
todo: unknown builtin type: Ibm128
|
||||
|
||||
@@ -111,6 +111,8 @@ func TestNonBuiltinTypes() {
|
||||
}
|
||||
}
|
||||
class a::b::c`,
|
||||
|
||||
`int (*p)(int, char);`,
|
||||
}
|
||||
|
||||
for _, t := range tests {
|
||||
|
||||
Reference in New Issue
Block a user