aboutsummaryrefslogtreecommitdiff
path: root/test/Transforms/Coroutines
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-06-03 15:20:36 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-06-03 15:20:36 +0000
commitd288ef4c1788d3a951a7558c68312c2d320612b1 (patch)
treeece909a5200f95f85f0813599a9500620f4d9217 /test/Transforms/Coroutines
parentf382538d471e38a9b98f016c4caebd24c8d60b62 (diff)
Notes
Diffstat (limited to 'test/Transforms/Coroutines')
-rw-r--r--test/Transforms/Coroutines/coro-split-02.ll5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/Transforms/Coroutines/coro-split-02.ll b/test/Transforms/Coroutines/coro-split-02.ll
index 953c25088652..4dc8921cd69a 100644
--- a/test/Transforms/Coroutines/coro-split-02.ll
+++ b/test/Transforms/Coroutines/coro-split-02.ll
@@ -1,5 +1,6 @@
; Tests that coro-split can handle the case when a code after coro.suspend uses
; a value produces between coro.save and coro.suspend (%Result.i19)
+; and checks whether stray coro.saves are properly removed
; RUN: opt < %s -coro-split -S | FileCheck %s
%"struct.std::coroutine_handle" = type { i8* }
@@ -24,9 +25,10 @@ entry:
i8 1, label %exit
]
await.ready:
+ %StrayCoroSave = call token @llvm.coro.save(i8* null)
%val = load i32, i32* %Result.i19
call void @print(i32 %val)
- br label %exit
+ br label %exit
exit:
call i1 @llvm.coro.end(i8* null, i1 false)
ret void
@@ -35,6 +37,7 @@ exit:
; CHECK-LABEL: @a.resume(
; CHECK: getelementptr inbounds %a.Frame
; CHECK-NEXT: getelementptr inbounds %"struct.lean_future<int>::Awaiter"
+; CHECK-NOT: call token @llvm.coro.save(i8* null)
; CHECK-NEXT: %val = load i32, i32* %Result
; CHECK-NEXT: call void @print(i32 %val)
; CHECK-NEXT: ret void