1 ; RUN: opt < %s -S -passes=coro-early | FileCheck %s
2 %struct.A = type <{ i64, i64, i32, [4 x i8] }>
4 define void @f(ptr nocapture readonly noalias align 8 %a) presplitcoroutine {
5 %id = call token @llvm.coro.id(i32 0, ptr null, ptr null, ptr null)
6 %size = call i32 @llvm.coro.size.i32()
7 %alloc = call ptr @malloc(i32 %size)
8 %hdl = call ptr @llvm.coro.begin(token %id, ptr %alloc)
9 call void @print(i32 0)
10 %s1 = call i8 @llvm.coro.suspend(token none, i1 false)
11 switch i8 %s1, label %suspend [i8 0, label %resume
14 call void @print(i32 1)
18 %mem = call ptr @llvm.coro.free(token %id, ptr %hdl)
19 call void @free(ptr %mem)
22 call i1 @llvm.coro.end(ptr %hdl, i1 0, token none)
26 ; check that the noalias attribute is removed from the argument
27 ; CHECK: define void @f(ptr nocapture readonly align 8 %a)
29 declare token @llvm.coro.id(i32, ptr, ptr, ptr)
30 declare ptr @llvm.coro.begin(token, ptr)
31 declare ptr @llvm.coro.free(token, ptr)
32 declare i32 @llvm.coro.size.i32()
33 declare i8 @llvm.coro.suspend(token, i1)
34 declare void @llvm.coro.resume(ptr)
35 declare void @llvm.coro.destroy(ptr)
36 declare i1 @llvm.coro.end(ptr, i1, token)
38 declare noalias ptr @malloc(i32)
39 declare void @print(i32)
40 declare void @free(ptr)