Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / llvm / test / tools / llvm-readobj / COFF / arm64-unwind-reference.yaml
blob80a9dfa739436c06e4306c7509c857acfde765f9
1 # Test reading an ExceptionRecord which is referenced in different ways:
2 # - Relocation against base of .xdata record, immediate offset in .pdata
3 #   (what LLVM produces)
4 # - Relocation against symbol in .xdata, no immediate offset in .pdata
5 #   (what MSVC produces)
6 # - Combination of the two above (unlikely to occur in the wild, but for
7 #   testing the consistency of the code)
9 # RUN: yaml2obj %s -o %t.obj
10 # RUN: llvm-readobj --unwind %t.obj | FileCheck %s
12 # CHECK:      UnwindInformation [
13 # CHECK-NEXT:   RuntimeFunction {
14 # CHECK-NEXT:     Function: func (0x0)
15 # CHECK-NEXT:     ExceptionRecord: .xdata (0x0)
16 # CHECK-NEXT:     ExceptionData {
17 # CHECK-NEXT:       FunctionLength: 4
18 # CHECK-NEXT:       Version: 0
19 # CHECK-NEXT:       ExceptionData: No
20 # CHECK-NEXT:       EpiloguePacked: No
21 # CHECK-NEXT:       EpilogueScopes: 0
22 # CHECK-NEXT:       ByteCodeLength: 4
23 # CHECK-NEXT:       Prologue [
24 # CHECK-NEXT:         0xd400              ; str x19, [sp, #-8]!
25 # CHECK-NEXT:         0xe4                ; end
26 # CHECK-NEXT:       ]
27 # CHECK-NEXT:       EpilogueScopes [
28 # CHECK-NEXT:       ]
29 # CHECK-NEXT:     }
30 # CHECK-NEXT:   }
31 # CHECK-NEXT:   RuntimeFunction {
32 # CHECK-NEXT:     Function: func2 (0x4)
33 # CHECK-NEXT:     ExceptionRecord: .xdata +0x8 (0x8)
34 # CHECK-NEXT:     ExceptionData {
35 # CHECK-NEXT:       FunctionLength: 4
36 # CHECK-NEXT:       Version: 0
37 # CHECK-NEXT:       ExceptionData: No
38 # CHECK-NEXT:       EpiloguePacked: No
39 # CHECK-NEXT:       EpilogueScopes: 0
40 # CHECK-NEXT:       ByteCodeLength: 4
41 # CHECK-NEXT:       Prologue [
42 # CHECK-NEXT:         0xdc01              ; str d8, [sp, #8]
43 # CHECK-NEXT:         0xe4                ; end
44 # CHECK-NEXT:       ]
45 # CHECK-NEXT:       EpilogueScopes [
46 # CHECK-NEXT:       ]
47 # CHECK-NEXT:     }
48 # CHECK-NEXT:   }
49 # CHECK-NEXT:   RuntimeFunction {
50 # CHECK-NEXT:     Function: func3 (0x8)
51 # CHECK-NEXT:     ExceptionRecord: func3_xdata (0x10)
52 # CHECK-NEXT:     ExceptionData {
53 # CHECK-NEXT:       FunctionLength: 4
54 # CHECK-NEXT:       Version: 0
55 # CHECK-NEXT:       ExceptionData: No
56 # CHECK-NEXT:       EpiloguePacked: No
57 # CHECK-NEXT:       EpilogueScopes: 0
58 # CHECK-NEXT:       ByteCodeLength: 4
59 # CHECK-NEXT:       Prologue [
60 # CHECK-NEXT:         0xe1                ; mov fp, sp
61 # CHECK-NEXT:         0xe4                ; end
62 # CHECK-NEXT:       ]
63 # CHECK-NEXT:       EpilogueScopes [
64 # CHECK-NEXT:       ]
65 # CHECK-NEXT:     }
66 # CHECK-NEXT:   }
67 # CHECK-NEXT:   RuntimeFunction {
68 # CHECK-NEXT:     Function: func4 (0xC)
69 # CHECK-NEXT:     ExceptionRecord: func3_xdata +0x8 (0x18)
70 # CHECK-NEXT:     ExceptionData {
71 # CHECK-NEXT:       FunctionLength: 4
72 # CHECK-NEXT:       Version: 0
73 # CHECK-NEXT:       ExceptionData: No
74 # CHECK-NEXT:       EpiloguePacked: No
75 # CHECK-NEXT:       EpilogueScopes: 0
76 # CHECK-NEXT:       ByteCodeLength: 4
77 # CHECK-NEXT:       Prologue [
78 # CHECK-NEXT:         0x81                ; stp x29, x30, [sp, #-16]!
79 # CHECK-NEXT:         0xe4                ; end
80 # CHECK-NEXT:       ]
81 # CHECK-NEXT:       EpilogueScopes [
82 # CHECK-NEXT:       ]
83 # CHECK-NEXT:     }
84 # CHECK-NEXT:   }
85 # CHECK-NEXT: ]
87 --- !COFF
88 header:
89   Machine:         IMAGE_FILE_MACHINE_ARM64
90   Characteristics: [  ]
91 sections:
92   - Name:            .text
93     Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
94     Alignment:       4
95     SectionData:     F38F1FF8E80700FDFD030091FD7BBFA9
96   - Name:            .xdata
97     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
98     Alignment:       4
99     SectionData:     01000008D400E4E301000008DC01E4E301000008E1E4E3E30100000881E4E3E3
100   - Name:            .pdata
101     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
102     Alignment:       4
103     SectionData:     '0000000000000000000000000800000000000000000000000000000008000000'
104     Relocations:
105       - VirtualAddress:  0
106         SymbolName:      func
107         Type:            IMAGE_REL_ARM64_ADDR32NB
108       - VirtualAddress:  4
109         SymbolName:      .xdata
110         Type:            IMAGE_REL_ARM64_ADDR32NB
111       - VirtualAddress:  8
112         SymbolName:      func2
113         Type:            IMAGE_REL_ARM64_ADDR32NB
114       - VirtualAddress:  12
115         SymbolName:      .xdata
116         Type:            IMAGE_REL_ARM64_ADDR32NB
117       - VirtualAddress:  16
118         SymbolName:      func3
119         Type:            IMAGE_REL_ARM64_ADDR32NB
120       - VirtualAddress:  20
121         SymbolName:      func3_xdata
122         Type:            IMAGE_REL_ARM64_ADDR32NB
123       - VirtualAddress:  24
124         SymbolName:      func4
125         Type:            IMAGE_REL_ARM64_ADDR32NB
126       - VirtualAddress:  28
127         SymbolName:      func3_xdata
128         Type:            IMAGE_REL_ARM64_ADDR32NB
129 symbols:
130   - Name:            .text
131     Value:           0
132     SectionNumber:   1
133     SimpleType:      IMAGE_SYM_TYPE_NULL
134     ComplexType:     IMAGE_SYM_DTYPE_NULL
135     StorageClass:    IMAGE_SYM_CLASS_STATIC
136     SectionDefinition:
137       Length:          16
138       NumberOfRelocations: 0
139       NumberOfLinenumbers: 0
140       CheckSum:        2581817939
141       Number:          1
142   - Name:            .xdata
143     Value:           0
144     SectionNumber:   2
145     SimpleType:      IMAGE_SYM_TYPE_NULL
146     ComplexType:     IMAGE_SYM_DTYPE_NULL
147     StorageClass:    IMAGE_SYM_CLASS_STATIC
148     SectionDefinition:
149       Length:          32
150       NumberOfRelocations: 0
151       NumberOfLinenumbers: 0
152       CheckSum:        3086971960
153       Number:          2
154   - Name:            .pdata
155     Value:           0
156     SectionNumber:   3
157     SimpleType:      IMAGE_SYM_TYPE_NULL
158     ComplexType:     IMAGE_SYM_DTYPE_NULL
159     StorageClass:    IMAGE_SYM_CLASS_STATIC
160     SectionDefinition:
161       Length:          32
162       NumberOfRelocations: 8
163       NumberOfLinenumbers: 0
164       CheckSum:        0
165       Number:          3
166   - Name:            func
167     Value:           0
168     SectionNumber:   1
169     SimpleType:      IMAGE_SYM_TYPE_NULL
170     ComplexType:     IMAGE_SYM_DTYPE_NULL
171     StorageClass:    IMAGE_SYM_CLASS_STATIC
172   - Name:            func2
173     Value:           4
174     SectionNumber:   1
175     SimpleType:      IMAGE_SYM_TYPE_NULL
176     ComplexType:     IMAGE_SYM_DTYPE_NULL
177     StorageClass:    IMAGE_SYM_CLASS_STATIC
178   - Name:            func3
179     Value:           8
180     SectionNumber:   1
181     SimpleType:      IMAGE_SYM_TYPE_NULL
182     ComplexType:     IMAGE_SYM_DTYPE_NULL
183     StorageClass:    IMAGE_SYM_CLASS_STATIC
184   - Name:            func4
185     Value:           12
186     SectionNumber:   1
187     SimpleType:      IMAGE_SYM_TYPE_NULL
188     ComplexType:     IMAGE_SYM_DTYPE_NULL
189     StorageClass:    IMAGE_SYM_CLASS_STATIC
190   - Name:            func3_xdata
191     Value:           16
192     SectionNumber:   2
193     SimpleType:      IMAGE_SYM_TYPE_NULL
194     ComplexType:     IMAGE_SYM_DTYPE_NULL
195     StorageClass:    IMAGE_SYM_CLASS_STATIC