|
5 | 5 |
|
6 | 6 | // REQUIRES: swift_feature_CoroutineAccessors |
7 | 7 |
|
| 8 | +// CHECK-LABEL: %T19coroutine_accessors1SV = type <{ %AnyObject, %TSi }> |
| 9 | + |
| 10 | +// CHECK-LABEL: @"$s19coroutine_accessors1SV3irmSivyTwc" = {{.*}}global %swift.coro_func_pointer |
| 11 | +// : sub ( |
| 12 | +// CHECK-SAME: $s19coroutine_accessors1SV3irmSivy |
| 13 | +// : $s19coroutine_accessors1SV3irmSivyTwc |
| 14 | +// : ) |
| 15 | +// CHECK-SAME: i32 0 |
| 16 | +// CHECK-SAME: }> |
8 | 17 | // CHECK-LABEL: @"$s19coroutine_accessors1SV3irmSivxTwc" = {{.*}}global{{.*}} %swift.coro_func_pointer <{ |
9 | 18 | // : sub ( |
10 | 19 | // CHECK-SAME: $s19coroutine_accessors1SV3irmSivx |
|
25 | 34 | // CHECK-SAME: } |
26 | 35 |
|
27 | 36 | // CHECK-LABEL: @_swift_coro_alloc( |
28 | | -// CHECK-SAME: ptr [[ALLOCATOR:%[^,]+]] |
| 37 | +// CHECK-SAME: ptr swiftcoro [[ALLOCATOR:%[^,]+]] |
29 | 38 | // CHECK-SAME: [[INT]] [[SIZE:%[^)]+]] |
30 | 39 | // CHECK-SAME: ) |
31 | 40 | // CHECK-SAME: { |
|
40 | 49 | // CHECK: } |
41 | 50 |
|
42 | 51 | // CHECK-LABEL: @_swift_coro_dealloc( |
43 | | -// CHECK-SAME: ptr [[ALLOCATOR:%[^,]+]] |
| 52 | +// CHECK-SAME: ptr swiftcoro [[ALLOCATOR:%[^,]+]] |
44 | 53 | // CHECK-SAME: ptr [[ADDRESS:%[^)]+]] |
45 | 54 | // CHECK-SAME: ) |
46 | 55 | // CHECK-SAME: { |
@@ -73,16 +82,81 @@ public var o: any AnyObject |
73 | 82 | public var _i: Int = 0 |
74 | 83 |
|
75 | 84 | public var irm: Int { |
| 85 | +// CHECK-LABEL: declare{{.*}} swiftcc void @"$s19coroutine_accessors1SVSiIetMIlYl_TC"(ptr noalias, ptr swiftcoro) |
| 86 | + |
76 | 87 | // CHECK-LABEL: define{{.*}} { ptr, {{i64|i32}} } @"$s19coroutine_accessors1SV3irmSivy"( |
| 88 | +// CHECK-SAME: ptr noalias [[FRAME:%[^,]+]], |
| 89 | +// CHECK-SAME: ptr swiftcoro [[ALLOCATOR:%[^,]+]], |
| 90 | +// CHECK-SAME: ptr [[S_FIELD_O:%[^,]+]], |
| 91 | +// CHECK-SAME: [[INT]] [[S_FIELD__I:%[^)]+]] |
77 | 92 | // CHECK-SAME: ) |
78 | 93 | // CHECK-SAME: { |
| 94 | +// CHECK: [[ID:%[^,]+]] = call token @llvm.coro.id.retcon.once.dynamic( |
| 95 | +// CHECK-SAME: i32 -1, |
| 96 | +// CHECK-SAME: i32 16, |
| 97 | +// CHECK-SAME: ptr @"$s19coroutine_accessors1SV3irmSivyTwc", |
| 98 | +// CHECK-SAME: ptr [[ALLOCATOR]], |
| 99 | +// CHECK-SAME: ptr [[FRAME]], |
| 100 | +// CHECK-SAME: ptr @"$s19coroutine_accessors1SVSiIetMIgYy_TC", |
| 101 | +// CHECK-SAME: ptr @_swift_coro_alloc, |
| 102 | +// CHECK-SAME: ptr @_swift_coro_dealloc |
| 103 | +// CHECK-SAME: ) |
| 104 | +// CHECK: [[HANDLE:%[^,]+]] = call ptr @llvm.coro.begin( |
| 105 | +// CHECK-SAME: token [[ID]], |
| 106 | +// CHECK-SAME: ptr null |
| 107 | +// CHECK-SAME: ) |
| 108 | +// CHECK: call ptr (...) @llvm.coro.suspend.retcon.p0([[INT]] [[S_FIELD__I]]) |
| 109 | +// CHECK: br i1 false, label %[[UNWIND:[^,]+]], label %[[NORMAL:[^,]+]] |
| 110 | +// CHECK: [[NORMAL]]: |
| 111 | +// CHECK: br label %coro.end |
| 112 | +// CHECK: [[UNWIND]]: |
| 113 | +// CHECK: br label %coro.end |
| 114 | +// CHECK: coro.end: |
| 115 | +// CHECK: call i1 @llvm.coro.end( |
| 116 | +// CHECK-SAME: ptr [[HANDLE]], |
| 117 | +// CHECK-SAME: i1 false, |
| 118 | +// CHECK-SAME: token none |
| 119 | +// CHECK-SAME: ) |
| 120 | +// CHECK: unreachable |
79 | 121 | // CHECK: } |
80 | 122 | read { |
81 | 123 | yield _i |
82 | 124 | } |
83 | 125 | // CHECK-LABEL: define{{.*}} { ptr, ptr } @"$s19coroutine_accessors1SV3irmSivx"( |
| 126 | +// CHECK-SAME: ptr noalias [[FRAME:%[^,]+]], |
| 127 | +// CHECK-SAME: ptr swiftcoro [[ALLOCATOR:%[^,]+]], |
| 128 | +// CHECK-SAME: ptr nocapture swiftself dereferenceable({{8|16}}) [[SELF:%[^)]+]] |
84 | 129 | // CHECK-SAME: ) |
85 | 130 | // CHECK-SAME: { |
| 131 | +// CHECK: [[ID:%[^,]+]] = call token @llvm.coro.id.retcon.once.dynamic( |
| 132 | +// CHECK-SAME: i32 -1, |
| 133 | +// CHECK-SAME: i32 16, |
| 134 | +// CHECK-SAME: ptr @"$s19coroutine_accessors1SV3irmSivxTwc", |
| 135 | +// CHECK-SAME: ptr [[ALLOCATOR]], |
| 136 | +// CHECK-SAME: ptr [[FRAME]], |
| 137 | +// CHECK-SAME: ptr @"$s19coroutine_accessors1SVSiIetMIlYl_TC", |
| 138 | +// CHECK-SAME: ptr @_swift_coro_alloc, |
| 139 | +// CHECK-SAME: ptr @_swift_coro_dealloc |
| 140 | +// CHECK-SAME: ) |
| 141 | +// CHECK: [[HANDLE:%[^,]+]] = call ptr @llvm.coro.begin( |
| 142 | +// CHECK-SAME: token [[ID]], |
| 143 | +// CHECK-SAME: ptr null |
| 144 | +// CHECK-SAME: ) |
| 145 | +// CHECK: [[S_FIELD__I:%[^,]+]] = getelementptr inbounds %T19coroutine_accessors1SV, |
| 146 | +// CHECK-SAME: ptr [[SELF]], |
| 147 | +// CHECK-SAME: i32 0, |
| 148 | +// CHECK-SAME: i32 1 |
| 149 | +// CHECK: call ptr (...) @llvm.coro.suspend.retcon.p0( |
| 150 | +// CHECK-SAME: ptr [[S_FIELD__I]] |
| 151 | +// CHECK-SAME: ) |
| 152 | +// CHECK: br i1 false, label %[[UNWIND:[^,]+]], label %[[NORMAL:[^,]+]] |
| 153 | +// CHECK: [[NORMAL]]: |
| 154 | +// CHECK: br label %coro.end |
| 155 | +// CHECK: [[UNWIND]]: |
| 156 | +// CHECK: br label %coro.end |
| 157 | +// CHECK: coro.end: |
| 158 | +// CHECK: [[REGISTER_8:%[^,]+]] = call i1 @llvm.coro.end(ptr [[HANDLE]], i1 false, token none) |
| 159 | +// CHECK: unreachable |
86 | 160 | // CHECK: } |
87 | 161 | modify { |
88 | 162 | yield &_i |
@@ -217,7 +291,7 @@ public var force_yield_once_2_convention : () { |
217 | 291 | } |
218 | 292 | // CHECK-LABEL: define{{.*}} { ptr, ptr } @increment_irm_yield_once_2( |
219 | 293 | // ptr noalias %0 |
220 | | -// CHECK-SAME: ptr [[ALLOCATOR:%[^,]+]] |
| 294 | +// CHECK-SAME: ptr swiftcoro [[ALLOCATOR:%[^,]+]] |
221 | 295 | // ptr nocapture swiftself dereferenceable(16) %2 |
222 | 296 | // CHECK-SAME: ) |
223 | 297 | // CHECK-SAME: { |
|
0 commit comments