@@ -120,7 +120,7 @@ class TaskContinuationFromLambda {
120120
121121 SWIFT_CC (swiftasync)
122122 static void invoke (SWIFT_ASYNC_CONTEXT AsyncContext *context, SWIFT_CONTEXT HeapObject *) {
123- (*lambdaStorage)(static_cast <Context*>(context));
123+ return (*lambdaStorage)(static_cast <Context*>(context));
124124 }
125125
126126public:
@@ -220,20 +220,20 @@ static AsyncTask *createTaskStoring(JobPriority priority,
220220TEST (ActorTest, validateTestHarness) {
221221 run ([] {
222222 auto task0 = createTask (JobPriority::Background,
223- [](AsyncContext *context) {
223+ [](AsyncContext *context) SWIFT_CC (swiftasync) {
224224 EXPECT_PROGRESS (5 );
225225 EXPECT_PROGRESS (6 );
226226 finishTest ();
227227 return context->ResumeParent (context);
228228 });
229229 auto task1 = createTask (JobPriority::Default,
230- [](AsyncContext *context) {
230+ [](AsyncContext *context) SWIFT_CC (swiftasync) {
231231 EXPECT_PROGRESS (1 );
232232 EXPECT_PROGRESS (2 );
233233 return context->ResumeParent (context);
234234 });
235235 auto task2 = createTask (JobPriority::Default,
236- [](AsyncContext *context) {
236+ [](AsyncContext *context) SWIFT_CC (swiftasync) {
237237 EXPECT_PROGRESS (3 );
238238 EXPECT_PROGRESS (4 );
239239 return context->ResumeParent (context);
@@ -254,22 +254,22 @@ TEST(ActorTest, actorSwitch) {
254254 auto actor = createActor ();
255255 auto task0 = createTaskStoring (JobPriority::Default,
256256 (AsyncTask*) nullptr , actor,
257- [](Context *context) {
257+ [](Context *context) SWIFT_CC (swiftasync) {
258258 EXPECT_PROGRESS (1 );
259259 EXPECT_TRUE (swift_task_getCurrentExecutor ().isGeneric ());
260260 EXPECT_EQ (nullptr , context->get <0 >());
261261 std::get<0 >(context->values ) = swift_task_getCurrent ();
262262
263263 auto continuation = prepareContinuation<Context>(
264- [](Context *context) {
264+ [](Context *context) SWIFT_CC (swiftasync) {
265265 EXPECT_PROGRESS (2 );
266266 auto executor = swift_task_getCurrentExecutor ();
267267 EXPECT_FALSE (executor.isGeneric ());
268268 EXPECT_EQ (ExecutorRef::forDefaultActor (context->get <1 >()),
269269 executor);
270270 EXPECT_EQ (swift_task_getCurrent (), context->get <0 >());
271271 auto continuation = prepareContinuation<Context>(
272- [](Context *context) {
272+ [](Context *context) SWIFT_CC (swiftasync) {
273273 EXPECT_PROGRESS (3 );
274274 EXPECT_TRUE (swift_task_getCurrentExecutor ().isGeneric ());
275275 EXPECT_EQ (swift_task_getCurrent (), context->get <0 >());
@@ -296,7 +296,7 @@ TEST(ActorTest, actorContention) {
296296
297297 auto task0 = createTaskStoring (JobPriority::Default,
298298 (AsyncTask*) nullptr , actor,
299- [](Context *context) {
299+ [](Context *context) SWIFT_CC (swiftasync) {
300300 EXPECT_PROGRESS (1 );
301301 EXPECT_TRUE (swift_task_getCurrentExecutor ().isGeneric ());
302302 EXPECT_EQ (nullptr , context->get <0 >());
@@ -305,7 +305,7 @@ TEST(ActorTest, actorContention) {
305305 std::get<0 >(context->values ) = task;
306306
307307 parkTask (task, context,
308- [](Context *context) {
308+ [](Context *context) SWIFT_CC (swiftasync) {
309309 EXPECT_PROGRESS (3 );
310310 auto executor = swift_task_getCurrentExecutor ();
311311 EXPECT_FALSE (executor.isGeneric ());
@@ -314,7 +314,7 @@ TEST(ActorTest, actorContention) {
314314 auto task = swift_task_getCurrent ();
315315 EXPECT_EQ (task, context->get <0 >());
316316 parkTask (task, context,
317- [](Context *context) {
317+ [](Context *context) SWIFT_CC (swiftasync) {
318318 EXPECT_PROGRESS (4 );
319319 EXPECT_TRUE (swift_task_getCurrentExecutor ().isGeneric ());
320320 EXPECT_EQ (swift_task_getCurrent (), context->get <0 >());
@@ -329,7 +329,7 @@ TEST(ActorTest, actorContention) {
329329
330330 auto task1 = createTaskStoring (JobPriority::Background,
331331 (AsyncTask*) nullptr , actor,
332- [](Context *context) {
332+ [](Context *context) SWIFT_CC (swiftasync) {
333333 EXPECT_PROGRESS (2 );
334334 auto executor = swift_task_getCurrentExecutor ();
335335 EXPECT_FALSE (executor.isGeneric ());
@@ -340,7 +340,7 @@ TEST(ActorTest, actorContention) {
340340 std::get<0 >(context->values ) = task;
341341
342342 parkTask (task, context,
343- [](Context *context) {
343+ [](Context *context) SWIFT_CC (swiftasync) {
344344 EXPECT_PROGRESS (5 );
345345 EXPECT_TRUE (swift_task_getCurrentExecutor ().isGeneric ());
346346 EXPECT_EQ (swift_task_getCurrent (), context->get <0 >());
0 commit comments