2 ; The following tests use the new pass manager, and verify that the coroutine
3 ; passes re-run the CGSCC pipeline.
4 ; RUN: opt < %s -S -passes='default<O0>' -enable-coroutines -debug-only=coro-split 2>&1 | FileCheck --check-prefix=CHECK-NEWPM %s
5 ; RUN: opt < %s -S -passes='default<O1>' -enable-coroutines -debug-only=coro-split 2>&1 | FileCheck --check-prefix=CHECK-NEWPM %s
7 ; CHECK: CoroSplit: Processing coroutine 'f' state: 0
8 ; CHECK-NEXT: CoroSplit: Processing coroutine 'f' state: 1
9 ; CHECK-NEWPM: CoroSplit: Processing coroutine 'f' state: 0
10 ; CHECK-NEWPM-NOT: CoroSplit: Processing coroutine 'f' state: 1
14 %id = call token @llvm.coro.id(i32 0, i8* null, i8* null, i8* null)
15 %size = call i32 @llvm.coro.size.i32()
16 %alloc = call i8* @malloc(i32 %size)
17 %hdl = call i8* @llvm.coro.begin(token %id, i8* %alloc)
18 call void @print(i32 0)
19 %s1 = call i8 @llvm.coro.suspend(token none, i1 false)
20 switch i8 %s1, label %suspend [i8 0, label %resume
23 call void @print(i32 1)
27 %mem = call i8* @llvm.coro.free(token %id, i8* %hdl)
28 call void @free(i8* %mem)
31 call i1 @llvm.coro.end(i8* %hdl, i1 0)
35 declare token @llvm.coro.id(i32, i8*, i8*, i8*)
36 declare i8* @llvm.coro.begin(token, i8*)
37 declare i8* @llvm.coro.free(token, i8*)
38 declare i32 @llvm.coro.size.i32()
39 declare i8 @llvm.coro.suspend(token, i1)
40 declare void @llvm.coro.resume(i8*)
41 declare void @llvm.coro.destroy(i8*)
42 declare i1 @llvm.coro.end(i8*, i1)
44 declare noalias i8* @malloc(i32)
45 declare void @print(i32)
46 declare void @free(i8*)