1 ; Verifies that restart trigger forces IPO pipelines restart and the same
2 ; coroutine is looked at by CoroSplit pass twice.
4 ; RUN: opt < %s -S -O0 -enable-coroutines -debug-only=coro-split 2>&1 | FileCheck %s
5 ; RUN: opt < %s -S -O1 -enable-coroutines -debug-only=coro-split 2>&1 | FileCheck %s
7 ; CHECK: CoroSplit: Processing coroutine 'f' state: 0
8 ; CHECK-NEXT: CoroSplit: Processing coroutine 'f' state: 1
11 %id = call token @llvm.coro.id(i32 0, i8* null, i8* null, i8* null)
12 %size = call i32 @llvm.coro.size.i32()
13 %alloc = call i8* @malloc(i32 %size)
14 %hdl = call i8* @llvm.coro.begin(token %id, i8* %alloc)
15 call void @print(i32 0)
16 %s1 = call i8 @llvm.coro.suspend(token none, i1 false)
17 switch i8 %s1, label %suspend [i8 0, label %resume
20 call void @print(i32 1)
24 %mem = call i8* @llvm.coro.free(token %id, i8* %hdl)
25 call void @free(i8* %mem)
28 call i1 @llvm.coro.end(i8* %hdl, i1 0)
32 declare token @llvm.coro.id(i32, i8*, i8*, i8*)
33 declare i8* @llvm.coro.begin(token, i8*)
34 declare i8* @llvm.coro.free(token, i8*)
35 declare i32 @llvm.coro.size.i32()
36 declare i8 @llvm.coro.suspend(token, i1)
37 declare void @llvm.coro.resume(i8*)
38 declare void @llvm.coro.destroy(i8*)
39 declare i1 @llvm.coro.end(i8*, i1)
41 declare noalias i8* @malloc(i32)
42 declare void @print(i32)
43 declare void @free(i8*)