llcppsigfetch:anony enum

This commit is contained in:
luoliwoshang
2024-10-24 17:46:33 +08:00
parent 09885c8f41
commit 05777019c8
3 changed files with 84 additions and 16 deletions

View File

@@ -8,6 +8,11 @@ func main() {
func TestEnumDecl() {
testCases := []string{
`enum {
a,
b,
c,
};`,
`enum Foo {
a,
b,

View File

@@ -11,10 +11,7 @@ TestEnumDecl Case 1:
},
"Doc": null,
"Parent": null,
"Name": {
"_Type": "Ident",
"Name": "Foo"
},
"Name": null,
"Type": {
"_Type": "EnumType",
"Items": [{
@@ -59,6 +56,65 @@ TestEnumDecl Case 1:
}
TestEnumDecl Case 2:
{
"temp.h": {
"_Type": "File",
"decls": [{
"_Type": "EnumTypeDecl",
"Loc": {
"_Type": "Location",
"File": "temp.h"
},
"Doc": null,
"Parent": null,
"Name": {
"_Type": "Ident",
"Name": "Foo"
},
"Type": {
"_Type": "EnumType",
"Items": [{
"_Type": "EnumItem",
"Name": {
"_Type": "Ident",
"Name": "a"
},
"Value": {
"_Type": "BasicLit",
"Kind": 0,
"Value": "0"
}
}, {
"_Type": "EnumItem",
"Name": {
"_Type": "Ident",
"Name": "b"
},
"Value": {
"_Type": "BasicLit",
"Kind": 0,
"Value": "1"
}
}, {
"_Type": "EnumItem",
"Name": {
"_Type": "Ident",
"Name": "c"
},
"Value": {
"_Type": "BasicLit",
"Kind": 0,
"Value": "2"
}
}]
}
}],
"includes": [],
"macros": []
}
}
TestEnumDecl Case 3:
{
"temp.h": {
"_Type": "File",
@@ -117,7 +173,7 @@ TestEnumDecl Case 2:
}
}
TestEnumDecl Case 3:
TestEnumDecl Case 4:
{
"temp.h": {
"_Type": "File",