Skip to content

Commit 2500257

Browse files
authored
Merge pull request #42125 from gottesmm/fix-filecheck-pattern-for-llvm-changes
[debug-info] Fix filecheck pattern for llvm changes
2 parents 541f772 + c57bc03 commit 2500257

File tree

2 files changed

+30
-26
lines changed

2 files changed

+30
-26
lines changed

test/DebugInfo/move_function_dbginfo.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,7 @@ public func copyableVarTest() {
198198
// We check that we get two separate locations for the different lifetimes of
199199
// the values.
200200
// DWARF-NEXT: [0x{{[a-z0-9]+}}, 0x{{[a-z0-9]+}}):
201-
// TODO: This is incorrect.
202-
// XWARF-NEXT: [0x{{[a-z0-9]+}}, 0x{{[a-z0-9]+}}):
201+
// DWARF-NEXT: [0x{{[a-z0-9]+}}, 0x{{[a-z0-9]+}}):
203202
// DWARF-NEXT: DW_AT_name ("k")
204203
// DWARF-NEXT: DW_AT_decl_file (
205204
// DWARF-NEXT: DW_AT_decl_line (
@@ -391,8 +390,7 @@ public func addressOnlyVarTest<T : P>(_ x: T) {
391390
// DWARF: DW_TAG_formal_parameter
392391
// DWARF-NEXT: DW_AT_location (0x{{[a-z0-9]+}}:
393392
// DWARF-NEXT: [0x{{[a-z0-9]+}}, 0x{{[a-z0-9]+}}):
394-
// TODO: We are missing a debug_value in codegen.
395-
// XWARF-NEXT: [0x{{[a-z0-9]+}}, 0x{{[a-z0-9]+}}):
393+
// DWARF-NEXT: [0x{{[a-z0-9]+}}, 0x{{[a-z0-9]+}}):
396394
// DWARF-NEXT: DW_AT_name ("k")
397395
// DWARF-NEXT: DW_AT_decl_file (
398396
// DWARF-NEXT: DW_AT_decl_line (

test/DebugInfo/move_function_dbginfo_async.swift

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -132,25 +132,33 @@ public func letSimpleTest<T>(_ msg: __owned T) async {
132132
// DWARF-NEXT: [0x{{[a-f0-9]+}}, 0x{{[a-f0-9]+}}): DW_OP_entry_value(DW_OP_reg14 R14), DW_OP_plus_uconst 0x[[MSG_LOC]], DW_OP_plus_uconst 0x8, DW_OP_deref)
133133
// DWARF-NEXT: DW_AT_name ("msg")
134134
//
135-
// TODO: Missing debug info in s3out13varSimpleTestyyxz_xtYalFTQ2_
135+
// We were just moved and are not reinit yet. This is caused by us hopping twice
136+
// when we return from an async function. Once for the async function and then
137+
// for the hop to executor.
138+
//
136139
// DWARF: DW_AT_linkage_name ("$s3out13varSimpleTestyyxz_xtYalFTQ2_")
137140
// DWARF: DW_AT_name ("varSimpleTest")
141+
// DWARF: DW_TAG_formal_parameter
142+
// DWARF-NEXT: DW_AT_name ("msg")
138143
//
139-
// We perform moves in this funclet so we at first have an entry_value value
140-
// that is moved and then we use a normal register.
144+
// We reinitialize our value in this funclet and then move it and then
145+
// reinitialize it again. So we have two different live ranges. Sadly, we don't
146+
// validate that the first live range doesn't start at the beginning of the
147+
// function. But we have lldb tests to validate that.
141148
//
142149
// DWARF: DW_AT_linkage_name ("$s3out13varSimpleTestyyxz_xtYalFTY3_")
143150
// DWARF: DW_AT_name ("varSimpleTest")
144151
// DWARF: DW_TAG_formal_parameter
145152
// DWARF: DW_AT_location (0x{{[a-f0-9]+}}:
146153
// DWARF-NEXT: [0x{{[a-f0-9]+}}, 0x{{[a-f0-9]+}}):
147154
// DWARF-SAME: DW_OP_entry_value(DW_OP_reg14 R14), DW_OP_plus_uconst 0x[[MSG_LOC]], DW_OP_plus_uconst 0x8, DW_OP_deref
148-
// DWARF-NEXT: [0x{{[a-f0-9]+}}, 0x{{[a-f0-9]+}})
149-
// DWARF-SAME: DW_OP_breg{{.*}}, DW_OP_deref, DW_OP_plus_uconst 0x[[MSG_LOC]], DW_OP_plus_uconst 0x8, DW_OP_deref
150-
// DWARF-NEXT: [0x{{[a-f0-9]+}}, 0x{{[a-f0-9]+}})
151-
// DWARF-SAME: DW_OP_breg{{.*}}, DW_OP_deref, DW_OP_plus_uconst 0x[[MSG_LOC]], DW_OP_plus_uconst 0x8, DW_OP_deref)
155+
// DWARF-NEXT: [0x{{[a-f0-9]+}}, 0x{{[a-f0-9]+}}):
156+
// DWARF-SAME: DW_OP_entry_value(DW_OP_reg14 R14), DW_OP_plus_uconst 0x[[MSG_LOC]], DW_OP_plus_uconst 0x8, DW_OP_deref
152157
// DWARF-NEXT: DW_AT_name ("msg")
153158
//
159+
// We did not move the value again here, so we just get a normal entry value for
160+
// the entire function.
161+
//
154162
// DWARF: DW_AT_linkage_name ("$s3out13varSimpleTestyyxz_xtYalFTQ4_")
155163
// DWARF: DW_AT_name ("varSimpleTest")
156164
// DWARF: DW_TAG_formal_parameter
@@ -160,10 +168,8 @@ public func letSimpleTest<T>(_ msg: __owned T) async {
160168
// DWARF: DW_AT_linkage_name ("$s3out13varSimpleTestyyxz_xtYalFTY5_")
161169
// DWARF: DW_AT_name ("varSimpleTest")
162170
// DWARF: DW_TAG_formal_parameter
163-
// DWARF: DW_AT_location (0x{{[a-f0-9]+}}:
164-
// DWARF: [0x{{[a-f0-9]+}}, 0x{{[a-f0-9]+}}): DW_OP_entry_value(DW_OP_reg14 R14), DW_OP_plus_uconst 0x10, DW_OP_plus_uconst 0x8, DW_OP_deref
165-
// DWARF: [0x{{[a-f0-9]+}}, 0x{{[a-f0-9]+}}): DW_OP_breg6 RBP-88, DW_OP_deref, DW_OP_plus_uconst 0x10, DW_OP_plus_uconst 0x8, DW_OP_deref)
166-
// DWARF: DW_AT_name ("msg")
171+
// DWARF-NEXT: DW_AT_location (DW_OP_entry_value(DW_OP_reg14 R14), DW_OP_plus_uconst 0x10, DW_OP_plus_uconst 0x8, DW_OP_deref
172+
// DWARF-NEXT: DW_AT_name ("msg")
167173

168174
// Change name to varSimpleTestArg
169175
public func varSimpleTest<T>(_ msg: inout T, _ msg2: T) async {
@@ -211,32 +217,33 @@ public func varSimpleTest<T>(_ msg: inout T, _ msg2: T) async {
211217
// DWARF: DW_AT_linkage_name ("$s3out16varSimpleTestVaryyYaF")
212218
//
213219
// DWARF: DW_AT_linkage_name ("$s3out16varSimpleTestVaryyYaFTY0_")
214-
// DWARF: DW_TAG_variable
215-
// DWARF-NEXT: DW_AT_location
216-
// DWARF-NEXT: DW_AT_name ("m")
217220
//
218221
// DWARF: DW_TAG_variable
219222
// DWARF-NEXT: DW_AT_location (DW_OP_entry_value(DW_OP_reg14 R14), DW_OP_plus_uconst 0x10, DW_OP_plus_uconst 0x8)
220223
// DWARF-NEXT: DW_AT_name ("k")
221224
//
222-
// DWARF: DW_AT_linkage_name ("$s3out16varSimpleTestVaryyYaFTQ1_")
223225
// DWARF: DW_TAG_variable
224-
// DWARF-NEXT: DW_AT_location (DW_OP_entry_value(DW_OP_reg14 R14), DW_OP_deref, DW_OP_plus_uconst 0x10, DW_OP_plus_uconst 0x10)
226+
// DWARF-NEXT: DW_AT_location
225227
// DWARF-NEXT: DW_AT_name ("m")
226228
//
229+
// DWARF: DW_AT_linkage_name ("$s3out16varSimpleTestVaryyYaFTQ1_")
230+
//
227231
// DWARF: DW_TAG_variable
228232
// DWARF-NEXT: DW_AT_location (DW_OP_entry_value(DW_OP_reg14 R14), DW_OP_deref, DW_OP_plus_uconst 0x10, DW_OP_plus_uconst 0x8)
229233
// DWARF-NEXT: DW_AT_name ("k")
230234
//
231-
// DWARF: DW_AT_linkage_name ("$s3out16varSimpleTestVaryyYaFTY2_")
232235
// DWARF: DW_TAG_variable
233-
// DWARF-NEXT: DW_AT_location
236+
// DWARF-NEXT: DW_AT_location (DW_OP_entry_value(DW_OP_reg14 R14), DW_OP_deref, DW_OP_plus_uconst 0x10, DW_OP_plus_uconst 0x10)
234237
// DWARF-NEXT: DW_AT_name ("m")
235238
//
239+
// DWARF: DW_AT_linkage_name ("$s3out16varSimpleTestVaryyYaFTY2_")
236240
// DWARF: DW_TAG_variable
237241
// DWARF-NEXT: DW_AT_location (0x{{[0-9a-f]+}}:
238242
// DWARF-NEXT: [0x{{[0-9a-f]+}}, 0x{{[0-9a-f]+}}): DW_OP_entry_value(DW_OP_reg14 R14), DW_OP_plus_uconst 0x10, DW_OP_plus_uconst 0x8)
239243
// DWARF-NEXT: DW_AT_name ("k")
244+
// DWARF: DW_TAG_variable
245+
// DWARF-NEXT: DW_AT_location
246+
// DWARF-NEXT: DW_AT_name ("m")
240247
//
241248
// DWARF: DW_AT_linkage_name ("$s3out16varSimpleTestVaryyYaFTQ3_")
242249
// DWARF: DW_TAG_variable
@@ -249,13 +256,12 @@ public func varSimpleTest<T>(_ msg: inout T, _ msg2: T) async {
249256
// We reinitialize k in 4.
250257
// DWARF: DW_AT_linkage_name ("$s3out16varSimpleTestVaryyYaFTY4_")
251258
// DWARF: DW_TAG_variable
252-
// DWARF-NEXT: DW_AT_location (DW_OP_entry_value(DW_OP_reg14 R14), DW_OP_plus_uconst 0x10, DW_OP_plus_uconst 0x10)
253-
// DWARF-NEXT: DW_AT_name ("m")
254-
//
255-
// DWARF: DW_TAG_variable
256259
// DWARF-NEXT: DW_AT_location (0x{{[0-9a-f]+}}:
257260
// DWARF-NEXT: [0x{{[0-9a-f]+}}, 0x{{[0-9a-f]+}}): DW_OP_entry_value(DW_OP_reg14 R14), DW_OP_plus_uconst 0x10, DW_OP_plus_uconst 0x8)
258261
// DWARF-NEXT: DW_AT_name ("k")
262+
// DWARF: DW_TAG_variable
263+
// DWARF-NEXT: DW_AT_location (DW_OP_entry_value(DW_OP_reg14 R14), DW_OP_plus_uconst 0x10, DW_OP_plus_uconst 0x10)
264+
// DWARF-NEXT: DW_AT_name ("m")
259265
public func varSimpleTestVar() async {
260266
var k = Klass()
261267
k.doSomething()

0 commit comments

Comments
 (0)