mirror of
https://github.com/apple/swift.git
synced 2026-06-20 15:42:51 +02:00
36 lines
1.1 KiB
Swift
36 lines
1.1 KiB
Swift
// RUN: %empty-directory(%t)
|
|
|
|
// RUN: %target-swift-frontend -swift-version 5 -enable-library-evolution -emit-module \
|
|
// 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: %t/borrow_accessors.swiftinterface -o %t/borrow_accessors.swiftmodule
|
|
|
|
// RUN: %target-swift-frontend -typecheck -I %t %s
|
|
|
|
|
|
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: }
|
|
|