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