1 ; Check that coro-split doesn't choke on intrinsics in unreachable blocks
2 ; RUN: opt < %s -coro-split -S
4 define i8* @f(i1 %arg) "coroutine.presplit"="1" personality i32 0 {
7 store i1 %arg, i1* %arg.addr
8 %id = call token @llvm.coro.id(i32 0, i8* null, i8* null, i8* null)
9 %size = call i32 @llvm.coro.size.i32()
10 %alloc = call i8* @malloc(i32 %size)
11 %hdl = call i8* @llvm.coro.begin(token %id, i8* %alloc)
15 %0 = call i8 @llvm.coro.suspend(token none, i1 false)
16 switch i8 %0, label %suspend [i8 0, label %resume
22 %mem = call i8* @llvm.coro.free(token %id, i8* %hdl)
23 call void @free(i8* %mem)
27 call i1 @llvm.coro.end(i8* %hdl, i1 0)
31 %argval = load i1, i1* %arg.addr
32 call void @print(i1 %argval)
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*)
43 declare token @llvm.coro.id(i32, i8*, i8*, i8*)
44 declare i1 @llvm.coro.alloc(token)
45 declare i8* @llvm.coro.begin(token, i8*)
46 declare i1 @llvm.coro.end(i8*, i1)
48 declare noalias i8* @malloc(i32)
49 declare void @print(i1)
50 declare void @free(i8*)