summaryrefslogtreecommitdiff
path: root/test/DebugInfo/PDB/Inputs
diff options
context:
space:
mode:
Diffstat (limited to 'test/DebugInfo/PDB/Inputs')
-rw-r--r--test/DebugInfo/PDB/Inputs/merge-ids-1.yaml36
-rw-r--r--test/DebugInfo/PDB/Inputs/merge-ids-2.yaml31
-rw-r--r--test/DebugInfo/PDB/Inputs/merge-ids-and-types-1.yaml113
-rw-r--r--test/DebugInfo/PDB/Inputs/merge-ids-and-types-2.yaml143
-rw-r--r--test/DebugInfo/PDB/Inputs/merge-types-1.yaml (renamed from test/DebugInfo/PDB/Inputs/merge1.yaml)0
-rw-r--r--test/DebugInfo/PDB/Inputs/merge-types-2.yaml (renamed from test/DebugInfo/PDB/Inputs/merge2.yaml)0
-rw-r--r--test/DebugInfo/PDB/Inputs/source-names-1.yaml8
-rw-r--r--test/DebugInfo/PDB/Inputs/source-names-2.yaml8
8 files changed, 339 insertions, 0 deletions
diff --git a/test/DebugInfo/PDB/Inputs/merge-ids-1.yaml b/test/DebugInfo/PDB/Inputs/merge-ids-1.yaml
new file mode 100644
index 000000000000..3b5e8b5e761a
--- /dev/null
+++ b/test/DebugInfo/PDB/Inputs/merge-ids-1.yaml
@@ -0,0 +1,36 @@
+IpiStream:
+ Records:
+ # 'One' [TypeIndex: 0x1000 (4096)]
+ - Kind: LF_STRING_ID
+ StringId:
+ Id: 0
+ String: 'One'
+ # 'Two' [TypeIndex: 0x1001 (4097)]
+ - Kind: LF_STRING_ID
+ StringId:
+ Id: 0
+ String: 'Two'
+ # 'OnlyInFirst' [TypeIndex: 0x1002 (4098)]
+ - Kind: LF_STRING_ID
+ StringId:
+ Id: 0
+ String: 'OnlyInFirst'
+ # 'SubOne' [TypeIndex: 0x1003 (4099)]
+ - Kind: LF_STRING_ID
+ StringId:
+ Id: 0
+ String: 'SubOne'
+ # 'SubTwo' [TypeIndex: 0x1004 (4100)]
+ - Kind: LF_STRING_ID
+ StringId:
+ Id: 0
+ String: 'SubTwo'
+ # 'SubOne', 'SubTwo' [TypeIndex: 0x1005 (4101)]
+ - Kind: LF_SUBSTR_LIST
+ StringList:
+ StringIndices: [ 4099, 4100 ]
+ # 'Main' {'SubOne', 'SubTwo'} [TypeIndex: 0x1006 (4102)]
+ - Kind: LF_STRING_ID
+ StringId:
+ Id: 4101
+ String: 'Main'
diff --git a/test/DebugInfo/PDB/Inputs/merge-ids-2.yaml b/test/DebugInfo/PDB/Inputs/merge-ids-2.yaml
new file mode 100644
index 000000000000..74f6ee502249
--- /dev/null
+++ b/test/DebugInfo/PDB/Inputs/merge-ids-2.yaml
@@ -0,0 +1,31 @@
+IpiStream:
+ Records:
+ # 'SubTwo' [TypeIndex: 0x1000 (4096)]
+ - Kind: LF_STRING_ID
+ StringId:
+ Id: 0
+ String: 'SubTwo'
+ # 'OnlyInSecond' [TypeIndex: 0x1001 (4097)]
+ - Kind: LF_STRING_ID
+ StringId:
+ Id: 0
+ String: 'OnlyInSecond'
+ # 'SubOne' [TypeIndex: 0x1002 (4098)]
+ - Kind: LF_STRING_ID
+ StringId:
+ Id: 0
+ String: 'SubOne'
+ # 'SubOne', 'SubTwo' [TypeIndex: 0x1003 (4099)]
+ - Kind: LF_SUBSTR_LIST
+ StringList:
+ StringIndices: [ 4098, 4096 ]
+ # 'One' [TypeIndex: 0x1004 (4100)]
+ - Kind: LF_STRING_ID
+ StringId:
+ Id: 0
+ String: 'One'
+ # 'Main' {'SubOne', 'SubTwo'} [TypeIndex: 0x1005 (4101)]
+ - Kind: LF_STRING_ID
+ StringId:
+ Id: 4099
+ String: 'Main'
diff --git a/test/DebugInfo/PDB/Inputs/merge-ids-and-types-1.yaml b/test/DebugInfo/PDB/Inputs/merge-ids-and-types-1.yaml
new file mode 100644
index 000000000000..30ff563d7fc6
--- /dev/null
+++ b/test/DebugInfo/PDB/Inputs/merge-ids-and-types-1.yaml
@@ -0,0 +1,113 @@
+# The idea is to set up some types in the TPI stream, and then have records in
+# the IPI stream that refer to them. There are three types of IPI records that
+# can refer to TPI records. They are:
+# 1) LF_PROCEDURE - Referred to by LF_FUNC_ID
+# 2) LF_STRUCTURE - Referred to by LF_UDT_MOD_SRC_LINE
+# Referred to by LF_UDT_SRC_LINE
+# 3) LF_MFUNCTION - Referred to by LF_MFUNC_ID
+# We will set up one of each of these, and then create IPI records that refer to
+# them. We intentionally choose an unintuitive ordering of the records in both
+# streams (while still maintaining the topological sorting required by CodeView
+# type streams), to make sure the merging algorithm is sufficiently exercised.
+# For easy understanding, a semantic representation of the types we will set up
+# is as follows:
+# - int main(int, char**)
+#
+# - struct FooBar {
+# public:
+# void *FooMember;
+# void FooMethod(int);
+# };
+TpiStream:
+ Records:
+ # TypeIndex: 4096 (0x1000)
+ # char**
+ - Kind: LF_POINTER
+ Pointer:
+ ReferentType: 1136
+ Attrs: 32778
+ # TypeIndex: 4097 (0x1001)
+ # public void *FooMember
+ - Kind: LF_FIELDLIST
+ FieldList:
+ - Kind: LF_MEMBER
+ DataMember:
+ Attrs: 3 # public
+ Type: 1027 # void*
+ FieldOffset: 0
+ Name: FooMember # FooMember
+ # TypeIndex: 4098 (0x1002)
+ # (int, char**)
+ - Kind: LF_ARGLIST
+ ArgList:
+ ArgIndices: [ 116, 4096 ]
+ # TypeIndex: 4099 (0x1003)
+ # struct FooBar {
+ # public:
+ # void *FooMember;
+ # };
+ - Kind: LF_STRUCTURE
+ Class:
+ MemberCount: 1
+ Options: [ None, HasUniqueName ]
+ FieldList: 4097
+ Name: FooBar
+ UniqueName: 'FooBar'
+ DerivationList: 0
+ VTableShape: 0
+ Size: 4
+ # TypeIndex: 4100 (0x1004)
+ # FooBar *
+ - Kind: LF_POINTER
+ Pointer:
+ ReferentType: 4099 # FooBar
+ Attrs: 32778
+ # TypeIndex: 4101 (0x1005)
+ # (int)
+ - Kind: LF_ARGLIST
+ ArgList:
+ ArgIndices: [ 116 ]
+ # TypeIndex: 4102 (0x1006)
+ - Kind: LF_MFUNCTION
+ MemberFunction:
+ ReturnType: 3 # void
+ ClassType: 4099 # struct FooBar
+ ThisType: 4100 # FooBar *
+ CallConv: ThisCall
+ Options: [ None, Constructor ]
+ ParameterCount: 1
+ ArgumentList: 4101 # (int)
+ ThisPointerAdjustment: 0
+ # TypeIndex: 4103 (0x1007)
+ # int (int, char**)
+ - Kind: LF_PROCEDURE
+ Procedure:
+ ReturnType: 116 # int
+ CallConv: NearC
+ Options: [ None ]
+ ParameterCount: 2
+ ArgumentList: 4098 # (int, char**)
+IpiStream:
+ Records:
+ # TypeIndex: 4096 (0x1000)
+ # int main(int, char **)
+ - Kind: LF_FUNC_ID
+ FuncId:
+ ParentScope: 0
+ FunctionType: 4103 # int main(int, char**)
+ Name: main
+ # TypeIndex: 4097 (0x1001)
+ # void FooBar::FooMethod(int)
+ - Kind: LF_MFUNC_ID
+ MemberFuncId:
+ ClassType: 4099 # struct FooBar
+ FunctionType: 4102 # void FooMethod(int)
+ Name: FooMethod
+ # TypeIndex: 4098 (0x1002)
+ # struct FooBar
+ - Kind: LF_UDT_MOD_SRC_LINE
+ UdtModSourceLine:
+ UDT: 4099 # struct FooBar
+ SourceFile: 0 # We don't support this yet
+ LineNumber: 0
+ Module: 0 # We don't support this yet
diff --git a/test/DebugInfo/PDB/Inputs/merge-ids-and-types-2.yaml b/test/DebugInfo/PDB/Inputs/merge-ids-and-types-2.yaml
new file mode 100644
index 000000000000..1bd54deebffd
--- /dev/null
+++ b/test/DebugInfo/PDB/Inputs/merge-ids-and-types-2.yaml
@@ -0,0 +1,143 @@
+# In file 1 we set up some basic types and IDs to refer to them. In this file
+# we will set up the same types. For some of them we will make them identical
+# but re-order the records in the file to make sure they have different type
+# indices and appear in different orders. In other cases we will make slight
+# adjustments to the types, to ensure that they do not get merged in.
+#
+# For easy understanding, a semantic representation of the types we will set up
+# is as follows:
+# - int main(int, char**) // This record should share an LF_PROCEDURE and id
+# // record with corresponding function from the
+# // first file.
+# - int main2(int, char**) // This record should share the LF_PROCEDURE
+# // record but have a unique id record.
+# - void foo(int, char**) // This record should have a unique LF_PROCEDURE
+# // record, but the LF_ARGLIST record internally
+# // should be shared.
+#
+# - struct FooBar { // Because the type of this record exactly matches
+# // the corresponding file, its entire type record
+# // hierarchy should be shared.
+# public:
+# void *FooMember;
+# void FooMethod2(int); // Note that the *type* of this member should be
+# // the same as the type of the record from the
+# // first stream. But since it has a different
+# // name, it will not share an id record.
+# };
+TpiStream:
+ Records:
+ # TypeIndex: 4096 (0x1000)
+ # (int)
+ - Kind: LF_ARGLIST
+ ArgList:
+ ArgIndices: [ 116 ]
+ # TypeIndex: 4097 (0x1001)
+ # public void *FooMember
+ - Kind: LF_FIELDLIST
+ FieldList:
+ - Kind: LF_MEMBER
+ DataMember:
+ Attrs: 3 # public
+ Type: 1027 # void*
+ FieldOffset: 0
+ Name: FooMember # FooMember
+ # TypeIndex: 4098 (0x1002)
+ # char**
+ - Kind: LF_POINTER
+ Pointer:
+ ReferentType: 1136
+ Attrs: 32778
+ # TypeIndex: 4099 (0x1003)
+ # (int, char**)
+ - Kind: LF_ARGLIST
+ ArgList:
+ ArgIndices: [ 116, 4098 ]
+ # TypeIndex: 4100 (0x1004)
+ # struct FooBar {
+ # public:
+ # void *FooMember;
+ # };
+ - Kind: LF_STRUCTURE
+ Class:
+ MemberCount: 1
+ Options: [ None, HasUniqueName ]
+ FieldList: 4097
+ Name: FooBar
+ UniqueName: 'FooBar'
+ DerivationList: 0
+ VTableShape: 0
+ Size: 4
+ # TypeIndex: 4101 (0x1005)
+ # void (int, char**)
+ - Kind: LF_PROCEDURE
+ Procedure:
+ ReturnType: 3 # void
+ CallConv: NearC
+ Options: [ None ]
+ ParameterCount: 2
+ ArgumentList: 4099 # (int, char**)
+ # TypeIndex: 4102 (0x1006)
+ # FooBar *
+ - Kind: LF_POINTER
+ Pointer:
+ ReferentType: 4100 # FooBar
+ Attrs: 32778
+ # TypeIndex: 4103 (0x1007)
+ # int (int, char**)
+ - Kind: LF_PROCEDURE
+ Procedure:
+ ReturnType: 116 # int
+ CallConv: NearC
+ Options: [ None ]
+ ParameterCount: 2
+ ArgumentList: 4099 # (int, char**)
+ # TypeIndex: 4104 (0x1008)
+ - Kind: LF_MFUNCTION
+ MemberFunction:
+ ReturnType: 3 # void
+ ClassType: 4100 # struct FooBar
+ ThisType: 4102 # FooBar *
+ CallConv: ThisCall
+ Options: [ None, Constructor ]
+ ParameterCount: 1
+ ArgumentList: 4096 # (int)
+ ThisPointerAdjustment: 0
+IpiStream:
+ Records:
+ # TypeIndex: 4096 (0x1000)
+ # struct FooBar
+ - Kind: LF_UDT_MOD_SRC_LINE
+ UdtModSourceLine:
+ UDT: 4100 # struct FooBar
+ SourceFile: 0 # We don't support this yet
+ LineNumber: 0
+ Module: 0 # We don't support this yet
+ # TypeIndex: 4097 (0x1001)
+ # int main2(int, char **)
+ - Kind: LF_FUNC_ID
+ FuncId:
+ ParentScope: 0
+ FunctionType: 4103 # int main2(int, char**)
+ Name: main2
+ # TypeIndex: 4098 (0x1002)
+ # void foo(int, char **)
+ - Kind: LF_FUNC_ID
+ FuncId:
+ ParentScope: 0
+ FunctionType: 4101 # void main2(int, char**)
+ Name: foo
+ # TypeIndex: 4099 (0x1003)
+ # void FooBar::FooMethod2(int)
+ - Kind: LF_MFUNC_ID
+ MemberFuncId:
+ ClassType: 4100 # struct FooBar
+ FunctionType: 4104 # void FooBar::FooMethod2(int)
+ Name: FooMethod2
+ # TypeIndex: 4100 (0x1004)
+ # int main(int, char **)
+ - Kind: LF_FUNC_ID
+ FuncId:
+ ParentScope: 0
+ FunctionType: 4103 # int main(int, char**)
+ Name: main
diff --git a/test/DebugInfo/PDB/Inputs/merge1.yaml b/test/DebugInfo/PDB/Inputs/merge-types-1.yaml
index 89d471e3343d..89d471e3343d 100644
--- a/test/DebugInfo/PDB/Inputs/merge1.yaml
+++ b/test/DebugInfo/PDB/Inputs/merge-types-1.yaml
diff --git a/test/DebugInfo/PDB/Inputs/merge2.yaml b/test/DebugInfo/PDB/Inputs/merge-types-2.yaml
index b6cbdb98f0ca..b6cbdb98f0ca 100644
--- a/test/DebugInfo/PDB/Inputs/merge2.yaml
+++ b/test/DebugInfo/PDB/Inputs/merge-types-2.yaml
diff --git a/test/DebugInfo/PDB/Inputs/source-names-1.yaml b/test/DebugInfo/PDB/Inputs/source-names-1.yaml
new file mode 100644
index 000000000000..96f7dedd2fc4
--- /dev/null
+++ b/test/DebugInfo/PDB/Inputs/source-names-1.yaml
@@ -0,0 +1,8 @@
+---
+DbiStream:
+ Modules:
+ - Module: 'C:\src\test.obj'
+ ObjFile: 'C:\src\test.obj'
+ SourceFiles:
+ - 'C:\src\test.c'
+...
diff --git a/test/DebugInfo/PDB/Inputs/source-names-2.yaml b/test/DebugInfo/PDB/Inputs/source-names-2.yaml
new file mode 100644
index 000000000000..5f782ddbca25
--- /dev/null
+++ b/test/DebugInfo/PDB/Inputs/source-names-2.yaml
@@ -0,0 +1,8 @@
+---
+DbiStream:
+ Modules:
+ - Module: 'C:\src\test.obj'
+ ObjFile: 'C:\src\test.obj'
+ SourceFiles:
+ - 'C:\src\test.cc'
+...