1 ; Verify that we don't crash when eliding coro_elide_safe callsites.
2 ; RUN: opt < %s -passes='cgscc(function<>(simplifycfg<>),function-attrs,coro-split,coro-annotation-elide)' -S | FileCheck %s
4 ; CHECK-LABEL: define void @foo()
5 define void @foo() presplitcoroutine personality ptr null {
7 %0 = call token @llvm.coro.save(ptr null)
11 ; Check that we don't call bar at all.
12 ; CHECK-NOT: call void @bar{{.*}}
13 call void @bar() coro_elide_safe
14 ; CHECK: call token @llvm.coro.id(i32 0, ptr null, ptr null, ptr @bar.resumers)
18 ; CHECK-LABEL: define void @bar()
19 define void @bar() presplitcoroutine personality ptr null {
21 %0 = call token @llvm.coro.id(i32 0, ptr null, ptr null, ptr null)
22 %1 = call ptr @llvm.coro.begin(token %0, ptr null)
23 %2 = call token @llvm.coro.save(ptr null)
24 %3 = call i8 @llvm.coro.suspend(token none, i1 false)
28 declare token @llvm.coro.id(i32, ptr readnone, ptr nocapture readonly, ptr) nounwind
29 declare ptr @llvm.coro.begin(token, ptr writeonly) nounwind
30 declare token @llvm.coro.save(ptr) nomerge nounwind
31 declare i8 @llvm.coro.suspend(token, i1) nounwind