1 ; Make sure that all library helper coro intrinsics are lowered.
2 ; RUN: opt < %s -coro-cleanup -S | FileCheck %s
3 ; RUN: opt < %s -passes=coro-cleanup -S | FileCheck %s
5 ; CHECK-LABEL: @uses_library_support_coro_intrinsics(
6 ; CHECK-NOT: @llvm.coro
9 define void @uses_library_support_coro_intrinsics(i8* %hdl) {
11 %0 = call i8* @llvm.coro.subfn.addr(i8* %hdl, i8 0)
12 %1 = bitcast i8* %0 to void (i8*)*
13 call fastcc void %1(i8* %hdl)
14 %2 = call i8* @llvm.coro.subfn.addr(i8* %hdl, i8 1)
15 %3 = bitcast i8* %2 to void (i8*)*
16 call fastcc void %3(i8* %hdl)
17 %4 = bitcast i8* %hdl to i8**
18 %5 = load i8*, i8** %4
19 %6 = icmp eq i8* %5, null
22 declare void @llvm.coro.resume(i8*)
23 declare void @llvm.coro.destroy(i8*)
24 ; Function Attrs: argmemonly nounwind
25 declare i1 @llvm.coro.done(i8* nocapture readonly) #0
26 ; Function Attrs: argmemonly nounwind readonly
27 declare i8* @llvm.coro.subfn.addr(i8* nocapture readonly, i8) #1
29 attributes #0 = { argmemonly nounwind }
30 attributes #1 = { argmemonly nounwind readonly }