summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/Inputs
diff options
context:
space:
mode:
authorAleksandr Urakov <aleksandr.urakov@jetbrains.com>2018-07-31 08:27:06 +0000
committerAleksandr Urakov <aleksandr.urakov@jetbrains.com>2018-07-31 08:27:06 +0000
commitcd5b56f4ccdd9fe19700b9ea45bf754fe34648a5 (patch)
treea2cf2b18c782aaca37cd3783cc67c90459d834ae /test/CodeGenCXX/Inputs
parenta7a88118684e7ea75ae229b1ae9b2ac31c7d5fcc (diff)
Improve support of PDB as an external layout source
Summary: This patch improves support of PDB as an external layout source in the next cases: - Multiple non-virtual inheritance from packed base classes. When using external layout, there's no need to align `NonVirtualSize` of a base class. It may cause an overlapping when the next base classes will be layouted (but there is a slightly different case in the test because I can't find a way to specify a base offset); - Support of nameless structs and unions. There is no info about nameless child structs and unions in Microsoft cl-emitted PDBs. Instead all its fields are just treated as outer structure's (union's) fields. This also causes a fields overlapping, and makes it possible for unions to have fields located at a non-zero offset. Reviewers: rsmith, zturner, rnk, mstorsjo, majnemer Reviewed By: rnk Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D49871 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@338353 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/Inputs')
-rw-r--r--test/CodeGenCXX/Inputs/override-layout-nameless-struct-union.layout16
-rw-r--r--test/CodeGenCXX/Inputs/override-layout-packed-base.layout18
2 files changed, 34 insertions, 0 deletions
diff --git a/test/CodeGenCXX/Inputs/override-layout-nameless-struct-union.layout b/test/CodeGenCXX/Inputs/override-layout-nameless-struct-union.layout
new file mode 100644
index 0000000000..9eb4d244bd
--- /dev/null
+++ b/test/CodeGenCXX/Inputs/override-layout-nameless-struct-union.layout
@@ -0,0 +1,16 @@
+
+*** Dumping AST Record Layout
+Type: struct S
+
+Layout: <ASTRecordLayout
+ Size:64
+ Alignment:32
+ FieldOffsets: [0, 32, 32]>
+
+*** Dumping AST Record Layout
+Type: union U
+
+Layout: <ASTRecordLayout
+ Size:96
+ Alignment:32
+ FieldOffsets: [0, 0, 32, 64, 68, 73]>
diff --git a/test/CodeGenCXX/Inputs/override-layout-packed-base.layout b/test/CodeGenCXX/Inputs/override-layout-packed-base.layout
new file mode 100644
index 0000000000..949215ab84
--- /dev/null
+++ b/test/CodeGenCXX/Inputs/override-layout-packed-base.layout
@@ -0,0 +1,18 @@
+
+*** Dumping AST Record Layout
+Type: class B<0>
+
+Layout: <ASTRecordLayout
+ FieldOffsets: [0, 32]>
+
+*** Dumping AST Record Layout
+Type: class B<1>
+
+Layout: <ASTRecordLayout
+ FieldOffsets: [0, 32]>
+
+*** Dumping AST Record Layout
+Type: class C
+
+Layout: <ASTRecordLayout
+ FieldOffsets: [80]>