Files
swift-mirror/test/ModuleInterface/borrow_accessor_test.swift
Becca Royal-Gordon 1f008fb0d0 [ModuleInterface] Enable module selectors by default
And update tests to use them.

This commit depends on fixes in swiftlang/swift PRs #86905, #87129, and #87130.

Fixes rdar://169749886.
2026-02-20 00:35:23 -08:00

40 lines
1.3 KiB
Swift

// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend -swift-version 5 -enable-library-evolution -emit-module \
// RUN: -enable-experimental-feature BorrowAndMutateAccessors \
// RUN: -o %t/borrow_accessors.swiftmodule \
// RUN: -emit-module-interface-path %t/borrow_accessors.swiftinterface \
// RUN: %S/Inputs/borrow_accessors.swift
// Check the interfaces
// RUN: %FileCheck %s < %t/borrow_accessors.swiftinterface
// See if we can compile a module through just the interface and typecheck using it.
// RUN: %target-swift-frontend -compile-module-from-interface \
// RUN: -enable-experimental-feature BorrowAndMutateAccessors \
// RUN: %t/borrow_accessors.swiftinterface -o %t/borrow_accessors.swiftmodule
// RUN: %target-swift-frontend -typecheck -I %t %s \
// RUN: -enable-experimental-feature BorrowAndMutateAccessors
// REQUIRES: swift_feature_BorrowAndMutateAccessors
import borrow_accessors
// CHECK: public protocol P {
// CHECK: #if compiler(>=5.3) && $BorrowAndMutateAccessors
// CHECK: var k: borrow_accessors::Klass { borrow mutate }
// CHECK: #endif
// CHECK: }
// CHECK: public struct Wrapper : borrow_accessors::P {
// CHECK: #if compiler(>=5.3) && $BorrowAndMutateAccessors
// CHECK: public var k: borrow_accessors::Klass {
// CHECK: borrow
// CHECK: mutate
// CHECK: }
// CHECK: #endif
// CHECK: }