Skip to content

Commit 0462e35

Browse files
committed
[Test] Use runAsync to invoke async cc test.
1 parent 9116af9 commit 0462e35

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

test/IRGen/async/run-call-struct_five_bools-to-void.sil

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ entry(%pack : $Pack):
4141
return %printGeneric_result1 : $()
4242
}
4343

44+
// Defined in _Concurrency
45+
sil public_external @$s12_Concurrency8runAsyncyyyyYcF : $@convention(thin) (@guaranteed @async @callee_guaranteed () -> ()) -> ()
46+
4447
// CHECK-LL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @test_case(%swift.task* {{%[0-9]+}}, %swift.executor* {{%[0-9]+}}, %swift.context* {{%[0-9]+}}) {{#[0-9]*}} {
4548
sil @test_case : $@async @convention(thin) () -> () {
4649

@@ -64,12 +67,13 @@ sil @test_case : $@async @convention(thin) () -> () {
6467

6568
sil @main : $@async @convention(c) (Int32, UnsafeMutablePointer<Optional<UnsafeMutablePointer<Int8>>>) -> Int32 {
6669
bb0(%0 : $Int32, %1 : $UnsafeMutablePointer<Optional<UnsafeMutablePointer<Int8>>>):
67-
68-
%test_case = function_ref @test_case : $@convention(thin) @async () -> ()
69-
%result = apply %test_case() : $@convention(thin) @async () -> ()
7070

71-
%2 = integer_literal $Builtin.Int32, 0
72-
%3 = struct $Int32 (%2 : $Builtin.Int32)
73-
return %3 : $Int32
74-
}
71+
%2 = function_ref @test_case : $@convention(thin) @async () -> ()
72+
%3 = thin_to_thick_function %2 : $@convention(thin) @async () -> () to $@async @callee_guaranteed () -> ()
73+
%4 = function_ref @$s12_Concurrency8runAsyncyyyyYcF : $@convention(thin) (@guaranteed @async @callee_guaranteed () -> ()) -> ()
74+
%5 = apply %4(%3) : $@convention(thin) (@guaranteed @async @callee_guaranteed () -> ()) -> ()
7575

76+
%6 = integer_literal $Builtin.Int32, 0
77+
%7 = struct $Int32 (%6 : $Builtin.Int32)
78+
return %7 : $Int32
79+
}

0 commit comments

Comments
 (0)