1
1
// RUN: %empty-directory(%t)
2
- // RUN: %target-swift-frontend -parse-as-library -disable-availability-checking -Xllvm -sil-disable-pass=alloc-stack-hoisting - g -emit-ir -o - %s | %FileCheck %s
3
- // RUN: %target-swift-frontend -parse-as-library -disable-availability-checking -Xllvm -sil-disable-pass=alloc-stack-hoisting - g -c %s -o %t/out.o
2
+ // RUN: %target-swift-frontend -parse-as-library -disable-availability-checking -g -emit-ir -o - %s | %FileCheck %s
3
+ // RUN: %target-swift-frontend -parse-as-library -disable-availability-checking -g -c %s -o %t/out.o
4
4
// RUN: %llvm-dwarfdump --show-children %t/out.o | %FileCheck -check-prefix=DWARF %s
5
5
6
6
// This test checks that:
13
13
// We only run this on macOS right now since we would need to pattern match
14
14
// slightly differently on other platforms.
15
15
// REQUIRES: OS=macosx
16
- // REQUIRES: CPU=x86_64
16
+ // REQUIRES: CPU=x86_64 || CPU=arm64
17
17
// REQUIRES: optimized_stdlib
18
18
19
19
//////////////////
@@ -60,20 +60,20 @@ public func forceSplit() async {}
60
60
61
61
// DWARF: DW_AT_linkage_name ("$s3out13letSimpleTestyyxnYalF")
62
62
// DWARF: DW_TAG_formal_parameter
63
- // 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)
63
+ // DWARF-NEXT: DW_AT_location (DW_OP_entry_value([[ASYNC_REG:DW_OP_.*]] ), DW_OP_plus_uconst 0x10, DW_OP_plus_uconst 0x8, DW_OP_deref)
64
64
// DWARF-NEXT: DW_AT_name ("msg")
65
65
//
66
66
// DWARF: DW_AT_linkage_name ("$s3out13letSimpleTestyyxnYalFTQ0_")
67
67
// DWARF: DW_AT_name ("letSimpleTest")
68
68
// DWARF: DW_TAG_formal_parameter
69
- // DWARF-NEXT: DW_AT_location (DW_OP_entry_value(DW_OP_reg14 R14 ), DW_OP_deref, DW_OP_plus_uconst 0x[[MSG_LOC:[a-f0-9]+]], DW_OP_plus_uconst 0x8, DW_OP_deref)
69
+ // DWARF-NEXT: DW_AT_location (DW_OP_entry_value([[ASYNC_REG]] ), DW_OP_deref, DW_OP_plus_uconst 0x[[MSG_LOC:[a-f0-9]+]], DW_OP_plus_uconst 0x8, DW_OP_deref)
70
70
// DWARF-NEXT: DW_AT_name ("msg")
71
71
//
72
72
// DWARF: DW_AT_linkage_name ("$s3out13letSimpleTestyyxnYalFTY1_")
73
73
// DWARF: DW_AT_name ("letSimpleTest")
74
74
// DWARF: DW_TAG_formal_parameter
75
75
// DWARF: DW_AT_location (0x{{[a-f0-9]+}}:
76
- // 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)
76
+ // DWARF-NEXT: [0x{{[a-f0-9]+}}, 0x{{[a-f0-9]+}}): DW_OP_entry_value([[ASYNC_REG]] ), DW_OP_plus_uconst 0x[[MSG_LOC]], DW_OP_plus_uconst 0x8, DW_OP_deref)
77
77
// DWARF-NEXT: DW_AT_name ("msg")
78
78
public func letSimpleTest< T> ( _ msg: __owned T) async {
79
79
await forceSplit ( )
@@ -97,7 +97,7 @@ public func letSimpleTest<T>(_ msg: __owned T) async {
97
97
// CHECK: entryresume.1:
98
98
// CHECK: call void @llvm.dbg.addr(metadata i8* %0, metadata ![[METADATA:[0-9]+]], metadata !DIExpression(DW_OP_plus_uconst, 16, DW_OP_plus_uconst, 8, DW_OP_deref)), !dbg ![[ADDR_LOC:[0-9]+]]
99
99
// CHECK: call void @llvm.dbg.value(metadata %swift.opaque* undef, metadata ![[METADATA]], metadata !DIExpression(DW_OP_deref)), !dbg ![[ADDR_LOC]]
100
- // CHECK: musttail call swifttailcc void @"$s27move_function_dbginfo_async10forceSplityyYaF"(%swift.context* swiftasync %34)
100
+ // CHECK: musttail call swifttailcc void @"$s27move_function_dbginfo_async10forceSplityyYaF"(%swift.context* swiftasync
101
101
// CHECK-NEXT: ret void
102
102
// CHECK-NEXT: }
103
103
//
@@ -116,20 +116,20 @@ public func letSimpleTest<T>(_ msg: __owned T) async {
116
116
// DWARF: DW_AT_linkage_name ("$s3out13varSimpleTestyyxz_xtYalF")
117
117
// DWARF: DW_AT_name ("varSimpleTest")
118
118
// DWARF: DW_TAG_formal_parameter
119
- // 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)
119
+ // DWARF-NEXT: DW_AT_location (DW_OP_entry_value([[ASYNC_REG]] ), DW_OP_plus_uconst 0x10, DW_OP_plus_uconst 0x8, DW_OP_deref)
120
120
// DWARF-NEXT: DW_AT_name ("msg")
121
121
//
122
122
// DWARF: DW_AT_linkage_name ("$s3out13varSimpleTestyyxz_xtYalFTQ0_")
123
123
// DWARF: DW_AT_name ("varSimpleTest")
124
124
// DWARF: DW_TAG_formal_parameter
125
- // DWARF-NEXT: DW_AT_location (DW_OP_entry_value(DW_OP_reg14 R14 ), DW_OP_deref, DW_OP_plus_uconst 0x[[MSG_LOC:[a-f0-9]+]], DW_OP_plus_uconst 0x8, DW_OP_deref)
125
+ // DWARF-NEXT: DW_AT_location (DW_OP_entry_value([[ASYNC_REG]] ), DW_OP_deref, DW_OP_plus_uconst 0x[[MSG_LOC:[a-f0-9]+]], DW_OP_plus_uconst 0x8, DW_OP_deref)
126
126
// DWARF-NEXT: DW_AT_name ("msg")
127
127
//
128
128
// DWARF: DW_AT_linkage_name ("$s3out13varSimpleTestyyxz_xtYalFTY1_")
129
129
// DWARF: DW_AT_name ("varSimpleTest")
130
130
// DWARF: DW_TAG_formal_parameter
131
131
// DWARF-NEXT: DW_AT_location (0x{{[a-f0-9]+}}:
132
- // 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)
132
+ // DWARF-NEXT: [0x{{[a-f0-9]+}}, 0x{{[a-f0-9]+}}): DW_OP_entry_value([[ASYNC_REG]] ), DW_OP_plus_uconst 0x[[MSG_LOC]], DW_OP_plus_uconst 0x8, DW_OP_deref)
133
133
// DWARF-NEXT: DW_AT_name ("msg")
134
134
//
135
135
// We were just moved and are not reinit yet. This is caused by us hopping twice
@@ -151,9 +151,9 @@ public func letSimpleTest<T>(_ msg: __owned T) async {
151
151
// DWARF: DW_TAG_formal_parameter
152
152
// DWARF: DW_AT_location (0x{{[a-f0-9]+}}:
153
153
// DWARF-NEXT: [0x{{[a-f0-9]+}}, 0x{{[a-f0-9]+}}):
154
- // 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
154
+ // DWARF-SAME: DW_OP_entry_value([[ASYNC_REG]] ), DW_OP_plus_uconst 0x[[MSG_LOC]], DW_OP_plus_uconst 0x8, DW_OP_deref
155
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
156
+ // DWARF-SAME: DW_OP_entry_value([[ASYNC_REG]] ), DW_OP_plus_uconst 0x[[MSG_LOC]], DW_OP_plus_uconst 0x8, DW_OP_deref
157
157
// DWARF-NEXT: DW_AT_name ("msg")
158
158
//
159
159
// We did not move the value again here, so we just get a normal entry value for
@@ -162,13 +162,13 @@ public func letSimpleTest<T>(_ msg: __owned T) async {
162
162
// DWARF: DW_AT_linkage_name ("$s3out13varSimpleTestyyxz_xtYalFTQ4_")
163
163
// DWARF: DW_AT_name ("varSimpleTest")
164
164
// DWARF: DW_TAG_formal_parameter
165
- // DWARF-NEXT: DW_AT_location (DW_OP_entry_value(DW_OP_reg14 R14 ), DW_OP_deref, DW_OP_plus_uconst 0x[[MSG_LOC]], DW_OP_plus_uconst 0x8, DW_OP_deref)
165
+ // DWARF-NEXT: DW_AT_location (DW_OP_entry_value([[ASYNC_REG]] ), DW_OP_deref, DW_OP_plus_uconst 0x[[MSG_LOC]], DW_OP_plus_uconst 0x8, DW_OP_deref)
166
166
// DWARF-NEXT: DW_AT_name ("msg")
167
167
//
168
168
// DWARF: DW_AT_linkage_name ("$s3out13varSimpleTestyyxz_xtYalFTY5_")
169
169
// DWARF: DW_AT_name ("varSimpleTest")
170
170
// DWARF: DW_TAG_formal_parameter
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
171
+ // DWARF-NEXT: DW_AT_location (DW_OP_entry_value([[ASYNC_REG]] ), DW_OP_plus_uconst 0x10, DW_OP_plus_uconst 0x8, DW_OP_deref
172
172
// DWARF-NEXT: DW_AT_name ("msg")
173
173
174
174
// Change name to varSimpleTestArg
@@ -219,7 +219,7 @@ public func varSimpleTest<T>(_ msg: inout T, _ msg2: T) async {
219
219
// DWARF: DW_AT_linkage_name ("$s3out16varSimpleTestVaryyYaFTY0_")
220
220
//
221
221
// DWARF: DW_TAG_variable
222
- // DWARF-NEXT: DW_AT_location (DW_OP_entry_value(DW_OP_reg14 R14 ), DW_OP_plus_uconst 0x10, DW_OP_plus_uconst 0x8)
222
+ // DWARF-NEXT: DW_AT_location (DW_OP_entry_value([[ASYNC_REG]] ), DW_OP_plus_uconst 0x10, DW_OP_plus_uconst 0x8)
223
223
// DWARF-NEXT: DW_AT_name ("k")
224
224
//
225
225
// DWARF: DW_TAG_variable
@@ -229,25 +229,25 @@ public func varSimpleTest<T>(_ msg: inout T, _ msg2: T) async {
229
229
// DWARF: DW_AT_linkage_name ("$s3out16varSimpleTestVaryyYaFTQ1_")
230
230
//
231
231
// DWARF: DW_TAG_variable
232
- // 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)
232
+ // DWARF-NEXT: DW_AT_location (DW_OP_entry_value([[ASYNC_REG]] ), DW_OP_deref, DW_OP_plus_uconst 0x10, DW_OP_plus_uconst 0x8)
233
233
// DWARF-NEXT: DW_AT_name ("k")
234
234
//
235
235
// DWARF: DW_TAG_variable
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)
236
+ // DWARF-NEXT: DW_AT_location (DW_OP_entry_value([[ASYNC_REG]] ), DW_OP_deref, DW_OP_plus_uconst 0x10, DW_OP_plus_uconst 0x10)
237
237
// DWARF-NEXT: DW_AT_name ("m")
238
238
//
239
239
// DWARF: DW_AT_linkage_name ("$s3out16varSimpleTestVaryyYaFTY2_")
240
240
// DWARF: DW_TAG_variable
241
241
// DWARF-NEXT: DW_AT_location (0x{{[0-9a-f]+}}:
242
- // 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)
242
+ // DWARF-NEXT: [0x{{[0-9a-f]+}}, 0x{{[0-9a-f]+}}): DW_OP_entry_value([[ASYNC_REG]] ), DW_OP_plus_uconst 0x10, DW_OP_plus_uconst 0x8)
243
243
// DWARF-NEXT: DW_AT_name ("k")
244
244
// DWARF: DW_TAG_variable
245
245
// DWARF-NEXT: DW_AT_location
246
246
// DWARF-NEXT: DW_AT_name ("m")
247
247
//
248
248
// DWARF: DW_AT_linkage_name ("$s3out16varSimpleTestVaryyYaFTQ3_")
249
249
// DWARF: DW_TAG_variable
250
- // 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)
250
+ // DWARF-NEXT: DW_AT_location (DW_OP_entry_value([[ASYNC_REG]] ), DW_OP_deref, DW_OP_plus_uconst 0x10, DW_OP_plus_uconst 0x10)
251
251
// DWARF-NEXT: DW_AT_name ("m")
252
252
// K is dead here.
253
253
// DWARF: DW_TAG_variable
@@ -257,11 +257,8 @@ public func varSimpleTest<T>(_ msg: inout T, _ msg2: T) async {
257
257
// DWARF: DW_AT_linkage_name ("$s3out16varSimpleTestVaryyYaFTY4_")
258
258
// DWARF: DW_TAG_variable
259
259
// DWARF-NEXT: DW_AT_location (0x{{[0-9a-f]+}}:
260
- // 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)
260
+ // DWARF-NEXT: [0x{{[0-9a-f]+}}, 0x{{[0-9a-f]+}}): DW_OP_entry_value([[ASYNC_REG]] ), DW_OP_plus_uconst 0x10, DW_OP_plus_uconst 0x8)
261
261
// 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")
265
262
public func varSimpleTestVar( ) async {
266
263
var k = Klass ( )
267
264
k. doSomething ( )
0 commit comments