@@ -112,8 +112,32 @@ sil hidden @launch_discarding_future_in_group_with_executor : $@convention(thin)
112
112
bb0(%taskGroup : $Builtin.RawPointer, %taskExecutor : $Builtin.Executor, %taskFunction : $@Sendable @async @callee_guaranteed () -> @error Error, %flags: $Int):
113
113
%optTaskGroup = enum $Optional<Builtin.RawPointer>, #Optional.some!enumelt, %taskGroup : $Builtin.RawPointer
114
114
%optTaskExecutor = enum $Optional<Builtin.Executor>, #Optional.some!enumelt, %taskExecutor : $Builtin.Executor
115
+ // CHECK: [[GROUP_RECORD:%.*]] = alloca %swift.task_group_task_option
116
+ // CHECK: [[EXECUTOR_RECORD:%.*]] = alloca %swift.task_executor_task_option
115
117
// CHECK-NOT: br i1
116
- // CHECK: call swift{{(tail)?}}cc %swift.async_task_and_context @swift_task_create(
118
+
119
+ // CHECK: [[BASE_GEP:%.*]] = getelementptr inbounds %swift.task_group_task_option, ptr [[GROUP_RECORD]], i32 0, i32 0
120
+ // CHECK: [[FLAGS_GEP:%.*]] = getelementptr inbounds %swift.task_option, ptr [[BASE_GEP]], i32 0, i32 0
121
+ // CHECK: store [[INT]] 1, ptr [[FLAGS_GEP]], align
122
+ // CHECK: [[PARENT_GEP:%.*]] = getelementptr inbounds %swift.task_option, ptr [[BASE_GEP]], i32 0, i32 1
123
+ // CHECK: store [[INT]] 0, ptr [[PARENT_GEP]], align
124
+ // CHECK: [[GROUP_GEP:%.*]] = getelementptr inbounds %swift.task_group_task_option, ptr [[GROUP_RECORD]], i32 0, i32 1
125
+ // CHECK: store ptr %0, ptr [[GROUP_GEP]], align
126
+ // CHECK: [[OPTIONS_PTR:%.*]] = ptrtoint ptr [[GROUP_RECORD]] to [[INT]]
127
+
128
+ // CHECK: [[BASE_GEP:%.*]] = getelementptr inbounds %swift.task_executor_task_option, ptr [[EXECUTOR_RECORD]], i32 0, i32 0
129
+ // CHECK: [[FLAGS_GEP:%.*]] = getelementptr inbounds %swift.task_option, ptr [[BASE_GEP]], i32 0, i32 0
130
+ // CHECK: store [[INT]] 5, ptr [[FLAGS_GEP]], align
131
+ // CHECK: [[PARENT_GEP:%.*]] = getelementptr inbounds %swift.task_option, ptr [[BASE_GEP]], i32 0, i32 1
132
+ // CHECK: store [[INT]] [[OPTIONS_PTR]], ptr [[PARENT_GEP]], align
133
+ // CHECK: [[EXECUTOR_GEP:%.*]] = getelementptr inbounds %swift.task_executor_task_option, ptr [[EXECUTOR_RECORD]], i32 0, i32 1
134
+ // CHECK: [[EXECUTOR_IDENT_GEP:%.*]] = getelementptr inbounds %swift.executor, ptr [[EXECUTOR_GEP]], i32 0, i32 0
135
+ // CHECK: store [[INT]] %1, ptr [[EXECUTOR_IDENT_GEP]], align
136
+ // CHECK: [[EXECUTOR_IMPL_GEP:%.*]] = getelementptr inbounds %swift.executor, ptr [[EXECUTOR_GEP]], i32 0, i32 1
137
+ // CHECK: store [[INT]] %2, ptr [[EXECUTOR_IMPL_GEP]], align
138
+ // CHECK: [[OPTIONS_PTR:%.*]] = ptrtoint ptr [[EXECUTOR_RECORD]] to [[INT]]
139
+
140
+ // CHECK: call swift{{(tail)?}}cc %swift.async_task_and_context @swift_task_create([[INT]] %5, [[INT]] [[OPTIONS_PTR]]
117
141
%9 = builtin "createAsyncTask"(%flags : $Int, %optTaskGroup : $Optional<Builtin.RawPointer>, %optTaskExecutor: $Optional<Builtin.Executor>, %taskFunction : $@Sendable @async @callee_guaranteed () -> @error Error) : $(Builtin.NativeObject, Builtin.RawPointer)
118
142
%10 = tuple_extract %9 : $(Builtin.NativeObject, Builtin.RawPointer), 0
119
143
strong_release %10 : $Builtin.NativeObject
0 commit comments