Skip to content

Commit 903b509

Browse files
committed
Add test case for coro.alloca.free fix
1 parent bc3189a commit 903b509

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/IRGen/modifyaccessor.swift

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// RUN: %target-swift-frontend -emit-ir -disable-llvm-optzns -primary-file %s | %FileCheck %s
2+
extension Dictionary {
3+
subscript(alternate key: Key) -> Value? {
4+
get {
5+
return self[key]
6+
}
7+
_modify {
8+
var value: Value? = nil
9+
yield &value
10+
}
11+
}
12+
}
13+
14+
// CHECK-LABEL: define {{.*}}SSD14modifyaccessorE9alternateq_Sgx_tciM
15+
// CHECK: [[COROALLOCA:%.*]] = call token @llvm.coro.alloca.alloc
16+
// CHECK: call void @llvm.coro.alloca.free(token [[COROALLOCA]])

0 commit comments

Comments
 (0)