1RUN: llvm-readobj --stackmap %p/Inputs/stackmap-test.macho-x86-64 | FileCheck %s
2
3; Note: the macho object file in this test was generated in the following way:
4; llc -mtriple=x86_64-apple-darwin test/CodeGen/X86/stackmap.ll -o test/Object/Inputs/stackmap-test.macho-x86-64 -filetype=obj
5
6CHECK: LLVM StackMap Version: 3
7CHECK-NEXT: Num Functions: 16
8CHECK-NEXT:   Function address: 0, stack size: 8, callsite record count: 1
9CHECK-NEXT:   Function address: 0, stack size: 24, callsite record count: 1
10CHECK-NEXT:   Function address: 0, stack size: 8, callsite record count: 1
11CHECK-NEXT:   Function address: 0, stack size: 8, callsite record count: 1
12CHECK-NEXT:   Function address: 0, stack size: 8, callsite record count: 1
13CHECK-NEXT:   Function address: 0, stack size: 8, callsite record count: 1
14CHECK-NEXT:   Function address: 0, stack size: 8, callsite record count: 1
15CHECK-NEXT:   Function address: 0, stack size: 8, callsite record count: 1
16CHECK-NEXT:   Function address: 0, stack size: 8, callsite record count: 1
17CHECK-NEXT:   Function address: 0, stack size: 56, callsite record count: 1
18CHECK-NEXT:   Function address: 0, stack size: 56, callsite record count: 1
19CHECK-NEXT:   Function address: 0, stack size: 8, callsite record count: 1
20CHECK-NEXT:   Function address: 0, stack size: 56, callsite record count: 2
21CHECK-NEXT:   Function address: 0, stack size: 8, callsite record count: 4
22CHECK-NEXT:   Function address: 0, stack size: 56, callsite record count: 1
23CHECK-NEXT:   Function address: 0, stack size: 18446744073709551615, callsite record count: 1
24CHECK-NEXT: Num Constants: 3
25CHECK-NEXT:   #1: 2147483648
26CHECK-NEXT:   #2: 4294967295
27CHECK-NEXT:   #3: 4294967296
28CHECK-NEXT: Num Records: 20
29CHECK-NEXT:   Record ID: 1, instruction offset: 4
30CHECK-NEXT:     12 locations:
31CHECK-NEXT:       #1: Constant 4294967295, size: 8
32CHECK-NEXT:       #2: Constant 4294967295, size: 8
33CHECK-NEXT:       #3: Constant 65536, size: 8
34CHECK-NEXT:       #4: Constant 2000000000, size: 8
35CHECK-NEXT:       #5: Constant 2147483647, size: 8
36CHECK-NEXT:       #6: Constant 4294967295, size: 8
37CHECK-NEXT:       #7: Constant 4294967295, size: 8
38CHECK-NEXT:       #8: Constant 0, size: 8
39CHECK-NEXT:       #9: ConstantIndex #0 (2147483648), size: 8
40CHECK-NEXT:       #10: ConstantIndex #1 (4294967295), size: 8
41CHECK-NEXT:       #11: ConstantIndex #2 (4294967296), size: 8
42CHECK-NEXT:       #12: Constant 4294967295, size: 8
43CHECK-NEXT:     1 live-outs: [ R#7 (8-bytes) ]
44
45CHECK:        Record ID: 3, instruction offset: 22
46CHECK-NEXT:     2 locations:
47CHECK-NEXT:       #1: Register R#3, size: 8
48CHECK-NEXT:       #2: Register R#14, size: 8
49CHECK-NEXT:     0 live-outs: [ ]
50
51CHECK:        Record ID: 4, instruction offset: 10
52CHECK-NEXT:     2 locations:
53CHECK-NEXT:       #1: Register R#5, size: 8
54CHECK-NEXT:       #2: Register R#4, size: 8
55CHECK-NEXT:     0 live-outs: [ ]
56
57CHECK:        Record ID: 5, instruction offset: 4
58CHECK-NEXT:     2 locations:
59CHECK-NEXT:       #1: Register R#0, size: 8
60CHECK-NEXT:       #2: Register R#5, size: 8
61CHECK-NEXT:     2 live-outs: [ R#0 (8-bytes) R#7 (8-bytes) ]
62
63CHECK:        Record ID: 6, instruction offset: 4
64CHECK-NEXT:     2 locations:
65CHECK-NEXT:       #1: Register R#4, size: 8
66CHECK-NEXT:       #2: Register R#2, size: 8
67CHECK-NEXT:     1 live-outs: [ R#7 (8-bytes) ]
68
69CHECK:        Record ID: 7, instruction offset: 10
70CHECK-NEXT:     2 locations:
71CHECK-NEXT:       #1: Register R#2, size: 8
72CHECK-NEXT:       #2: Register R#8, size: 8
73CHECK-NEXT:     1 live-outs: [ R#7 (8-bytes) ]
74
75CHECK:        Record ID: 8, instruction offset: 10
76CHECK-NEXT:     2 locations:
77CHECK-NEXT:       #1: Register R#2, size: 8
78CHECK-NEXT:       #2: Register R#8, size: 8
79CHECK-NEXT:     2 live-outs: [ R#0 (8-bytes) R#7 (8-bytes) ]
80
81CHECK:        Record ID: 11, instruction offset: 4
82CHECK-NEXT:     17 locations:
83CHECK-NEXT:       #1: Register R#9, size: 8
84CHECK-NEXT:       #2: Indirect [R#6 + 16], size: 8
85CHECK-NEXT:       #3: Indirect [R#6 + 24], size: 8
86CHECK-NEXT:       #4: Indirect [R#6 + 32], size: 8
87CHECK-NEXT:       #5: Indirect [R#6 + 40], size: 8
88CHECK-NEXT:       #6: Indirect [R#6 + 48], size: 8
89CHECK-NEXT:       #7: Indirect [R#6 + 56], size: 8
90CHECK-NEXT:       #8: Indirect [R#6 + 64], size: 8
91CHECK-NEXT:       #9: Indirect [R#6 + 72], size: 8
92CHECK-NEXT:       #10: Indirect [R#6 + 80], size: 8
93CHECK-NEXT:       #11: Indirect [R#6 + 88], size: 8
94CHECK-NEXT:       #12: Indirect [R#6 + 96], size: 8
95CHECK-NEXT:       #13: Indirect [R#6 + 104], size: 8
96CHECK-NEXT:       #14: Indirect [R#6 + 112], size: 8
97CHECK-NEXT:       #15: Indirect [R#6 + 120], size: 8
98CHECK-NEXT:       #16: Indirect [R#6 + 128], size: 8
99CHECK-NEXT:       #17: Indirect [R#6 + 136], size: 8
100CHECK-NEXT:     1 live-outs: [ R#7 (8-bytes) ]
101
102CHECK:        Record ID: 12, instruction offset: 4
103CHECK-NEXT:     17 locations:
104CHECK-NEXT:       #1: Register R#0, size: 8
105CHECK-NEXT:       #2: Indirect [R#6 + 16], size: 8
106CHECK-NEXT:       #3: Indirect [R#6 + 24], size: 8
107CHECK-NEXT:       #4: Indirect [R#6 + 32], size: 8
108CHECK-NEXT:       #5: Indirect [R#6 + 40], size: 8
109CHECK-NEXT:       #6: Indirect [R#6 + 48], size: 8
110CHECK-NEXT:       #7: Indirect [R#6 + 56], size: 8
111CHECK-NEXT:       #8: Indirect [R#6 + 64], size: 8
112CHECK-NEXT:       #9: Indirect [R#6 + 72], size: 8
113CHECK-NEXT:       #10: Indirect [R#6 + 80], size: 8
114CHECK-NEXT:       #11: Indirect [R#6 + 88], size: 8
115CHECK-NEXT:       #12: Indirect [R#6 + 96], size: 8
116CHECK-NEXT:       #13: Indirect [R#6 + 104], size: 8
117CHECK-NEXT:       #14: Indirect [R#6 + 112], size: 8
118CHECK-NEXT:       #15: Indirect [R#6 + 120], size: 8
119CHECK-NEXT:       #16: Indirect [R#6 + 128], size: 8
120CHECK-NEXT:       #17: Indirect [R#6 + 136], size: 8
121CHECK-NEXT:     0 live-outs: [ ]
122
123CHECK:        Record ID: 13, instruction offset: 50
124CHECK-NEXT:     1 locations:
125CHECK-NEXT:       #1: Indirect [R#6 + -48], size: 4
126CHECK-NEXT:     0 live-outs: [ ]
127
128CHECK:        Record ID: 14, instruction offset: 24
129CHECK-NEXT:     2 locations:
130CHECK-NEXT:       #1: Register R#0, size: 1
131CHECK-NEXT:       #2: Register R#3, size: 1
132CHECK-NEXT:     0 live-outs: [ ]
133
134CHECK:        Record ID: 15, instruction offset: 4
135CHECK-NEXT:     1 locations:
136CHECK-NEXT:       #1: Constant 33, size: 8
137CHECK-NEXT:     0 live-outs: [ ]
138
139CHECK:        Record ID: 16, instruction offset: 16
140CHECK-NEXT:     1 locations:
141CHECK-NEXT:       #1: Direct R#6 + -40, size: 8
142CHECK-NEXT:     0 live-outs: [ ]
143
144CHECK:        Record ID: 17, instruction offset: 16
145CHECK-NEXT:     2 locations:
146CHECK-NEXT:       #1: Direct R#6 + -8, size: 8
147CHECK-NEXT:       #2: Direct R#6 + -16, size: 8
148CHECK-NEXT:     1 live-outs: [ R#7 (8-bytes) ]
149
150CHECK:        Record ID: 4294967295, instruction offset: 4
151CHECK-NEXT:     0 locations:
152CHECK-NEXT:     0 live-outs: [ ]
153
154CHECK:        Record ID: 4294967296, instruction offset: 4
155CHECK-NEXT:     0 locations:
156CHECK-NEXT:     0 live-outs: [ ]
157
158CHECK:        Record ID: 9223372036854775807, instruction offset: 4
159CHECK-NEXT:     0 locations:
160CHECK-NEXT:     0 live-outs: [ ]
161
162CHECK:        Record ID: 18446744073709551615, instruction offset: 4
163CHECK-NEXT:     0 locations:
164CHECK-NEXT:     1 live-outs: [ R#7 (8-bytes) ]
165
166CHECK:        Record ID: 16, instruction offset: 18
167CHECK-NEXT:     1 locations:
168CHECK-NEXT:       #1: Indirect [R#6 + -44], size: 4
169CHECK-NEXT:     0 live-outs: [ ]
170
171CHECK:        Record ID: 0, instruction offset: 25
172CHECK-NEXT:     0 locations:
173CHECK-NEXT:     0 live-outs: [ ]
174