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