xref: /llvm-project/llvm/test/DebugInfo/PDB/Inputs/merge-ids-and-types-1.yaml (revision d4136e945ed7d057b4bb376eb6f5299c76d31614)
1# The idea is to set up some types in the TPI stream, and then have records in
2# the IPI stream that refer to them.  There are three types of IPI records that
3# can refer to TPI records.  They are:
4# 1) LF_PROCEDURE - Referred to by LF_FUNC_ID
5# 2) LF_STRUCTURE - Referred to by LF_UDT_MOD_SRC_LINE
6#                   Referred to by LF_UDT_SRC_LINE
7# 3) LF_MFUNCTION - Referred to by LF_MFUNC_ID
8# We will set up one of each of these, and then create IPI records that refer to
9# them.  We intentionally choose an unintuitive ordering of the records in both
10# streams (while still maintaining the topological sorting required by CodeView
11# type streams), to make sure the merging algorithm is sufficiently exercised.
12# For easy understanding, a semantic representation of the types we will set up
13# is as follows:
14#  - int main(int, char**)
15#
16#  - struct FooBar {
17#    public:
18#      void *FooMember;
19#      void FooMethod(int);
20#    };
21TpiStream:
22  Records:
23    # TypeIndex: 4096 (0x1000)
24    # char**
25    - Kind:            LF_POINTER
26      Pointer:         
27        ReferentType:    1136
28        Attrs:           32778
29    # TypeIndex: 4097 (0x1001)
30    # public void *FooMember
31    - Kind:            LF_FIELDLIST
32      FieldList:       
33        - Kind:            LF_MEMBER
34          DataMember:      
35            Attrs:           3           # public
36            Type:            1027        # void*
37            FieldOffset:     0
38            Name:            FooMember   # FooMember
39    # TypeIndex: 4098 (0x1002)
40    # (int, char**)
41    - Kind:            LF_ARGLIST
42      ArgList:         
43        ArgIndices:      [ 116, 4096 ]
44    # TypeIndex: 4099 (0x1003)
45    # struct FooBar {
46    # public:
47    #   void *FooMember;
48    # };
49    - Kind:            LF_STRUCTURE
50      Class:           
51        MemberCount:     1
52        Options:         [ None, HasUniqueName ]
53        FieldList:       4097
54        Name:            FooBar
55        UniqueName:      'FooBar'
56        DerivationList:  0
57        VTableShape:     0
58        Size:            4
59    # TypeIndex: 4100 (0x1004)
60    # FooBar *
61    - Kind:            LF_POINTER
62      Pointer:         
63        ReferentType:    4099       # FooBar
64        Attrs:           32778
65    # TypeIndex: 4101 (0x1005)
66    # (int)
67    - Kind:            LF_ARGLIST
68      ArgList:         
69        ArgIndices:      [ 116 ]
70    # TypeIndex: 4102 (0x1006)
71    - Kind:            LF_MFUNCTION
72      MemberFunction:  
73        ReturnType:      3                      # void
74        ClassType:       4099                   # struct FooBar
75        ThisType:        4100                   # FooBar *
76        CallConv:        ThisCall
77        Options:         [ None, Constructor ]
78        ParameterCount:  1
79        ArgumentList:    4101                   # (int)
80        ThisPointerAdjustment: 0
81    # TypeIndex: 4103 (0x1007)
82    # int (int, char**)
83    - Kind:            LF_PROCEDURE
84      Procedure:       
85        ReturnType:      116         # int
86        CallConv:        NearC
87        Options:         [ None ]
88        ParameterCount:  2
89        ArgumentList:    4098        # (int, char**)
90IpiStream:
91  Records:
92    # TypeIndex: 4096 (0x1000)
93    # int main(int, char **)
94    - Kind:            LF_FUNC_ID
95      FuncId:          
96        ParentScope:     0
97        FunctionType:    4103       # int main(int, char**)
98        Name:            main
99    # TypeIndex: 4097 (0x1001)
100    # void FooBar::FooMethod(int)
101    - Kind:            LF_MFUNC_ID
102      MemberFuncId:    
103        ClassType:       4099       # struct FooBar
104        FunctionType:    4102       # void FooMethod(int)
105        Name:            FooMethod
106    # TypeIndex: 4098 (0x1002)
107    # struct FooBar
108    - Kind:            LF_UDT_MOD_SRC_LINE
109      UdtModSourceLine: 
110        UDT:             4099       # struct FooBar
111        SourceFile:      0          # We don't support this yet
112        LineNumber:      0
113        Module:          0          # We don't support this yet
114