Skip to content

Commit e796cc7

Browse files
add test case
1 parent 1f0d8b5 commit e796cc7

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
; RUN: opt < %s -passes='cgscc(function<>(simplifycfg<>),function-attrs,coro-split,coro-annotation-elide)' -S | FileCheck %s
2+
3+
; Function Attrs: presplitcoroutine
4+
define void @bar() #0 personality ptr null {
5+
entry:
6+
%0 = call token @llvm.coro.save(ptr null)
7+
br label %entry.invoke.cont9_crit_edge
8+
9+
entry.invoke.cont9_crit_edge: ; preds = %entry
10+
call void @foo(ptr null, ptr null, ptr null, ptr null) #4
11+
ret void
12+
}
13+
14+
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: read)
15+
declare token @llvm.coro.id(i32, ptr readnone, ptr nocapture readonly, ptr) #1
16+
17+
; Function Attrs: nounwind
18+
declare ptr @llvm.coro.begin(token, ptr writeonly) #2
19+
20+
; Function Attrs: nomerge nounwind
21+
declare token @llvm.coro.save(ptr) #3
22+
23+
; Function Attrs: nounwind
24+
declare i8 @llvm.coro.suspend(token, i1) #2
25+
26+
; Function Attrs: presplitcoroutine
27+
define void @foo(ptr %agg.result, ptr %this, ptr %queryRange, ptr %setName) #0 personality ptr null {
28+
entry:
29+
%0 = call token @llvm.coro.id(i32 0, ptr null, ptr null, ptr null)
30+
%1 = call ptr @llvm.coro.begin(token %0, ptr null)
31+
%2 = call token @llvm.coro.save(ptr null)
32+
%3 = call i8 @llvm.coro.suspend(token none, i1 false)
33+
ret void
34+
}
35+
36+
attributes #0 = { presplitcoroutine }
37+
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: read) }
38+
attributes #2 = { nounwind }
39+
attributes #3 = { nomerge nounwind }
40+
attributes #4 = { coro_elide_safe }
41+
42+
; CHECK: attributes

0 commit comments

Comments
 (0)