@@ -119,7 +119,7 @@ class TaskContinuationFromLambda {
119
119
120
120
SWIFT_CC (swiftasync)
121
121
static void invoke (SWIFT_ASYNC_CONTEXT AsyncContext *context, SWIFT_CONTEXT HeapObject *) {
122
- (*lambdaStorage)(static_cast <Context*>(context));
122
+ return (*lambdaStorage)(static_cast <Context*>(context));
123
123
}
124
124
125
125
public:
@@ -219,20 +219,20 @@ static AsyncTask *createTaskStoring(JobPriority priority,
219
219
TEST (ActorTest, validateTestHarness) {
220
220
run ([] {
221
221
auto task0 = createTask (JobPriority::Background,
222
- [](AsyncContext *context) {
222
+ [](AsyncContext *context) SWIFT_CC (swiftasync) {
223
223
EXPECT_PROGRESS (5 );
224
224
EXPECT_PROGRESS (6 );
225
225
finishTest ();
226
226
return context->ResumeParent (context);
227
227
});
228
228
auto task1 = createTask (JobPriority::Default,
229
- [](AsyncContext *context) {
229
+ [](AsyncContext *context) SWIFT_CC (swiftasync) {
230
230
EXPECT_PROGRESS (1 );
231
231
EXPECT_PROGRESS (2 );
232
232
return context->ResumeParent (context);
233
233
});
234
234
auto task2 = createTask (JobPriority::Default,
235
- [](AsyncContext *context) {
235
+ [](AsyncContext *context) SWIFT_CC (swiftasync) {
236
236
EXPECT_PROGRESS (3 );
237
237
EXPECT_PROGRESS (4 );
238
238
return context->ResumeParent (context);
@@ -253,22 +253,22 @@ TEST(ActorTest, actorSwitch) {
253
253
auto actor = createActor ();
254
254
auto task0 = createTaskStoring (JobPriority::Default,
255
255
(AsyncTask*) nullptr , actor,
256
- [](Context *context) {
256
+ [](Context *context) SWIFT_CC (swiftasync) {
257
257
EXPECT_PROGRESS (1 );
258
258
EXPECT_TRUE (swift_task_getCurrentExecutor ().isGeneric ());
259
259
EXPECT_EQ (nullptr , context->get <0 >());
260
260
std::get<0 >(context->values ) = swift_task_getCurrent ();
261
261
262
262
auto continuation = prepareContinuation<Context>(
263
- [](Context *context) {
263
+ [](Context *context) SWIFT_CC (swiftasync) {
264
264
EXPECT_PROGRESS (2 );
265
265
auto executor = swift_task_getCurrentExecutor ();
266
266
EXPECT_FALSE (executor.isGeneric ());
267
267
EXPECT_EQ (ExecutorRef::forDefaultActor (context->get <1 >()),
268
268
executor);
269
269
EXPECT_EQ (swift_task_getCurrent (), context->get <0 >());
270
270
auto continuation = prepareContinuation<Context>(
271
- [](Context *context) {
271
+ [](Context *context) SWIFT_CC (swiftasync) {
272
272
EXPECT_PROGRESS (3 );
273
273
EXPECT_TRUE (swift_task_getCurrentExecutor ().isGeneric ());
274
274
EXPECT_EQ (swift_task_getCurrent (), context->get <0 >());
@@ -295,7 +295,7 @@ TEST(ActorTest, actorContention) {
295
295
296
296
auto task0 = createTaskStoring (JobPriority::Default,
297
297
(AsyncTask*) nullptr , actor,
298
- [](Context *context) {
298
+ [](Context *context) SWIFT_CC (swiftasync) {
299
299
EXPECT_PROGRESS (1 );
300
300
EXPECT_TRUE (swift_task_getCurrentExecutor ().isGeneric ());
301
301
EXPECT_EQ (nullptr , context->get <0 >());
@@ -304,7 +304,7 @@ TEST(ActorTest, actorContention) {
304
304
std::get<0 >(context->values ) = task;
305
305
306
306
parkTask (task, context,
307
- [](Context *context) {
307
+ [](Context *context) SWIFT_CC (swiftasync) {
308
308
EXPECT_PROGRESS (3 );
309
309
auto executor = swift_task_getCurrentExecutor ();
310
310
EXPECT_FALSE (executor.isGeneric ());
@@ -313,7 +313,7 @@ TEST(ActorTest, actorContention) {
313
313
auto task = swift_task_getCurrent ();
314
314
EXPECT_EQ (task, context->get <0 >());
315
315
parkTask (task, context,
316
- [](Context *context) {
316
+ [](Context *context) SWIFT_CC (swiftasync) {
317
317
EXPECT_PROGRESS (4 );
318
318
EXPECT_TRUE (swift_task_getCurrentExecutor ().isGeneric ());
319
319
EXPECT_EQ (swift_task_getCurrent (), context->get <0 >());
@@ -328,7 +328,7 @@ TEST(ActorTest, actorContention) {
328
328
329
329
auto task1 = createTaskStoring (JobPriority::Background,
330
330
(AsyncTask*) nullptr , actor,
331
- [](Context *context) {
331
+ [](Context *context) SWIFT_CC (swiftasync) {
332
332
EXPECT_PROGRESS (2 );
333
333
auto executor = swift_task_getCurrentExecutor ();
334
334
EXPECT_FALSE (executor.isGeneric ());
@@ -339,7 +339,7 @@ TEST(ActorTest, actorContention) {
339
339
std::get<0 >(context->values ) = task;
340
340
341
341
parkTask (task, context,
342
- [](Context *context) {
342
+ [](Context *context) SWIFT_CC (swiftasync) {
343
343
EXPECT_PROGRESS (5 );
344
344
EXPECT_TRUE (swift_task_getCurrentExecutor ().isGeneric ());
345
345
EXPECT_EQ (swift_task_getCurrent (), context->get <0 >());
0 commit comments