• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt < %s -coro-early -coro-split -S | FileCheck %s
2target datalayout = "E-p:64:64"
3
4%swift.type = type { i64 }
5%swift.opaque = type opaque
6%T4red215EmptyCollectionV = type opaque
7%TSi = type <{ i64 }>
8
9define hidden swiftcc { i8*, %swift.opaque* } @no_suspends(i8* %buffer, i64 %arg) #1 {
10  %id = call token @llvm.coro.id.retcon.once(i32 32, i32 8, i8* %buffer, i8* bitcast (void (i8*, i1)* @prototype to i8*), i8* bitcast (i8* (i64)* @malloc to i8*), i8* bitcast (void (i8*)* @free to i8*))
11  %begin = call i8* @llvm.coro.begin(token %id, i8* null)
12  call void @print(i64 %arg)
13  call void @llvm.trap()
14  unreachable
15
16bb1:
17  call void @print(i64 %arg)
18  call i1 @llvm.coro.end(i8* %begin, i1 false)
19  unreachable
20}
21; CHECK-LABEL: define hidden swiftcc { i8*, %swift.opaque* } @no_suspends(
22; CHECK:         call token @llvm.coro.id.retcon.once
23; CHECK-NEXT:    call void @print(i64 %arg)
24; CHECK-NEXT:    call void @llvm.trap()
25; CHECK-NEXT:    unreachable
26
27declare swiftcc void @prototype(i8* noalias dereferenceable(32), i1)
28declare void @print(i64)
29
30declare noalias i8* @malloc(i64) #5
31declare void @free(i8* nocapture) #5
32
33declare token @llvm.coro.id.retcon.once(i32, i32, i8*, i8*, i8*, i8*) #5
34declare i8* @llvm.coro.begin(token, i8* writeonly) #5
35declare token @llvm.coro.alloca.alloc.i64(i64, i32) #5
36declare i8* @llvm.coro.alloca.get(token) #5
37declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) #6
38declare i1 @llvm.coro.suspend.retcon.i1(...) #5
39declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) #6
40declare void @llvm.coro.alloca.free(token) #5
41declare i1 @llvm.coro.end(i8*, i1) #5
42
43declare void @llvm.trap()
44
45attributes #1 = { noreturn nounwind }
46attributes #5 = { nounwind }
47