mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
If LLVM optimizations are to be disabled, we cannot just not run all LLVM passes, because there are some mandatory LLVM passes, like coro splitting. Instead, just run the -O0 LLVM pipeline if -disable-llvm-optzns is used. Fixes compiler crashes if -disable-llvm-optzns is used. Note: if one wants to see the output of IRGen, -emit-irgen can be used.
17 lines
459 B
Swift
17 lines
459 B
Swift
// RUN: %target-swift-frontend -emit-irgen -primary-file %s | %FileCheck %s
|
|
extension Dictionary {
|
|
subscript(alternate key: Key) -> Value? {
|
|
get {
|
|
return self[key]
|
|
}
|
|
_modify {
|
|
var value: Value? = nil
|
|
yield &value
|
|
}
|
|
}
|
|
}
|
|
|
|
// CHECK-LABEL: define {{.*}}sSD14modifyaccessorE9alternateq_Sgx_tciM
|
|
// CHECK: [[COROALLOCA:%.*]] = call token @llvm.coro.alloca.alloc
|
|
// CHECK: call void @llvm.coro.alloca.free(token [[COROALLOCA]])
|