llcppsigfetch:anonymous record name

This commit is contained in:
luoliwoshang
2024-08-21 14:50:42 +08:00
parent 5e5c84ba27
commit 815fe25f2c
4 changed files with 132 additions and 24 deletions

View File

@@ -85,6 +85,9 @@ void foo();`,
func TestStructDecl() {
testCases := []string{
`struct {
int a;
};`,
`struct A {
int a;
int b;
@@ -103,6 +106,10 @@ func TestStructDecl() {
func TestUnionDecl() {
testCases := []string{
`union {
int a;
int b;
};`,
`union A {
int a;
int b;

View File

@@ -958,9 +958,7 @@ TestStructDecl Case 1:
},
"Parent": null,
"Tag": 0,
"Name": {
"Name": "A"
},
"Name": null,
"Fields": {
"List": [{
"Type": {
@@ -976,20 +974,6 @@ TestStructDecl Case 1:
"Names": [{
"Name": "a"
}]
}, {
"Type": {
"Kind": 6,
"Flags": 0
},
"Doc": {
"List": []
},
"Comment": {
"List": []
},
"Names": [{
"Name": "b"
}]
}]
},
"Methods": []
@@ -1054,6 +1038,60 @@ TestStructDecl Case 2:
}
TestStructDecl Case 3:
{
"temp.h": {
"path": "temp.h",
"decls": [{
"Loc": {
"File": "temp.h"
},
"Doc": {
"List": []
},
"Parent": null,
"Tag": 0,
"Name": {
"Name": "A"
},
"Fields": {
"List": [{
"Type": {
"Kind": 6,
"Flags": 0
},
"Doc": {
"List": []
},
"Comment": {
"List": []
},
"Names": [{
"Name": "a"
}]
}, {
"Type": {
"Kind": 6,
"Flags": 0
},
"Doc": {
"List": []
},
"Comment": {
"List": []
},
"Names": [{
"Name": "b"
}]
}]
},
"Methods": []
}],
"includes": [],
"macros": []
}
}
TestStructDecl Case 4:
{
"temp.h": {
"path": "temp.h",
@@ -1318,6 +1356,58 @@ TestClassDecl Case 2:
}
TestUnionDecl Case 1:
{
"temp.h": {
"path": "temp.h",
"decls": [{
"Loc": {
"File": "temp.h"
},
"Doc": {
"List": []
},
"Parent": null,
"Tag": 1,
"Name": null,
"Fields": {
"List": [{
"Type": {
"Kind": 6,
"Flags": 0
},
"Doc": {
"List": []
},
"Comment": {
"List": []
},
"Names": [{
"Name": "a"
}]
}, {
"Type": {
"Kind": 6,
"Flags": 0
},
"Doc": {
"List": []
},
"Comment": {
"List": []
},
"Names": [{
"Name": "b"
}]
}]
},
"Methods": []
}],
"includes": [],
"macros": []
}
}
TestUnionDecl Case 2:
{
"temp.h": {
"path": "temp.h",