Skip to content

Commit 031baa1

Browse files
committed
Add reproducer for infinite loop case
1 parent 889ce26 commit 031baa1

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
; RUN: llvm-dis < %s.bc | FileCheck %s
2+
3+
; ModuleID = '../llvm-project/llvm/test/Transforms/Coroutines/coro-retcon-frame-auto-upgrade.bc'
4+
; CHECK: source_filename = "../llvm-project/llvm/test/Transforms/Coroutines/coro-retcon-frame-auto-upgrade.ll"
5+
; CHECK: target datalayout = "p:64:64:64"
6+
7+
; CHECK: declare void @prototype_f(ptr, i1)
8+
9+
; CHECK: declare noalias ptr @allocate(i32)
10+
11+
; CHECK: declare void @deallocate(ptr)
12+
13+
; CHECK: declare void @init(ptr)
14+
15+
; CHECK: declare void @use(ptr)
16+
17+
; CHECK: declare void @use_addr_val(i64, ptr)
18+
19+
; Function Attrs: presplitcoroutine
20+
; CHECK: define { ptr, ptr } @f(ptr %buffer) #0 {
21+
; CHECK: entry:
22+
; CHECK: %tmp = alloca { i64, i64 }, align 8
23+
; CHECK: %proj.1 = getelementptr inbounds { i64, i64 }, ptr %tmp, i64 0, i32 0
24+
; CHECK: %proj.2 = getelementptr inbounds { i64, i64 }, ptr %tmp, i64 0, i32 1
25+
; CHECK: store i64 0, ptr %proj.1, align 8
26+
; CHECK: store i64 0, ptr %proj.2, align 8
27+
; CHECK: %escape_addr = ptrtoint ptr %tmp to i64
28+
; CHECK: %id = call token (i32, i32, ptr, ptr, ptr, ptr, ...) @llvm.coro.id.retcon.once(i32 32, i32 8, ptr %buffer, ptr @prototype_f, ptr @allocate, ptr @deallocate)
29+
; CHECK: %hdl = call ptr @llvm.coro.begin(token %id, ptr null)
30+
; CHECK: %proj.2.2 = getelementptr inbounds { i64, i64 }, ptr %tmp, i64 0, i32 1
31+
; CHECK: call void @init(ptr %proj.1)
32+
; CHECK: call void @init(ptr %proj.2.2)
33+
; CHECK: call void @use_addr_val(i64 %escape_addr, ptr %tmp)
34+
; CHECK: %abort = call i1 (...) @llvm.coro.suspend.retcon.i1(ptr %tmp)
35+
; CHECK: br i1 %abort, label %end, label %resume
36+
37+
; CHECK: resume: ; preds = %entry
38+
; CHECK: call void @use(ptr %tmp)
39+
; CHECK: br label %end
40+
41+
; CHECK: end: ; preds = %resume, %entry
42+
; CHECK: %0 = call i1 @llvm.coro.end(ptr %hdl, i1 false, token none)
43+
; CHECK: unreachable
44+
; CHECK: }
45+
46+
; Function Attrs: nounwind
47+
; CHECK: declare ptr @llvm.coro.begin(token, ptr writeonly) #1
48+
49+
; Function Attrs: nounwind
50+
; CHECK: declare i1 @llvm.coro.suspend.retcon.i1(...) #1
51+
52+
; Function Attrs: nounwind
53+
; CHECK: declare i1 @llvm.coro.end(ptr, i1, token) #1
54+
55+
; Function Attrs: nounwind
56+
; CHECK: declare token @llvm.coro.id.retcon.once(i32, i32, ptr, ptr, ptr, ptr, ...) #1
57+
58+
; CHECK: attributes #0 = { presplitcoroutine }
59+
; CHECK: attributes #1 = { nounwind }
Binary file not shown.

0 commit comments

Comments
 (0)