Files
swift-mirror/test/IRGen/modifyaccessor.swift
2025-10-30 03:59:18 -07:00

17 lines
465 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]])