mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Right now the stdlib/overlays can compile against -Onone tests with or without -enable-ownership-stripping-after-serialization. This will help me to prevent other work going on from breaking these properties.
20 lines
909 B
Swift
20 lines
909 B
Swift
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -import-objc-header %S/Inputs/optional_closure_bridging.h -enforce-exclusivity=checked -swift-version 4 -emit-sil -primary-file %s -o /dev/null -verify
|
|
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -import-objc-header %S/Inputs/optional_closure_bridging.h -enforce-exclusivity=checked -swift-version 4 -emit-sil -primary-file %s -o /dev/null -verify -enable-ownership-stripping-after-serialization
|
|
// REQUIRES: objc_interop
|
|
|
|
import Foundation
|
|
|
|
class SomeClass {
|
|
@objc
|
|
func testCallNoEscapeBlockDirectly(_ c: @convention(block) () -> ()) {
|
|
c()
|
|
}
|
|
}
|
|
|
|
func testOptionalImport() {
|
|
var x = 0
|
|
// expected-error@+2{{overlapping accesses to 'x', but modification requires exclusive access; consider copying to a local variable}}
|
|
// expected-note@+1{{conflicting access is here}}
|
|
SomeObjCInterface.perform(&x) { x += 1 }
|
|
}
|