Files
swift-mirror/test/embedded/implementation-only-import-build.swift
Doug Gregor 020b69d4b6 [SE-0497] Implement @export attribute syntax
Implement the @export(implementation) and @export(interface) attributes
to replace @_alwaysEmitIntoClient and @_neverEmitIntoClient. Provide a
warning + Fix-It to start staging out the very-new
@_neverEmitIntoClient. We'll hold off on pushing folks toward
@_alwaysEmitIntoClient for a little longer.
2025-11-07 22:00:40 -08:00

67 lines
1.4 KiB
Swift

// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend -emit-module -o %t/indirects.swiftmodule \
// RUN: %S/../Sema/Inputs/implementation-only-imports/indirects.swift \
// RUN: -enable-experimental-feature Embedded
// RUN: %target-swift-frontend -emit-module -o %t/directs.swiftmodule -I %t\
// RUN: %S/../Sema/Inputs/implementation-only-imports/directs.swift \
// RUN: -enable-experimental-feature Embedded
// RUN: %target-swift-frontend -emit-sil %s -I %t \
// RUN: -enable-experimental-feature Embedded
// REQUIRES: swift_feature_Embedded
// REQUIRES: embedded_stdlib_cross_compiling
@_implementationOnly import directs
import indirects
internal func localInternalFunc() {}
public func implicitlyInlinablePublic() {
localInternalFunc()
}
private func implicitlyInlinablePrivate() {
localInternalFunc()
}
@export(interface)
public func explicitNonInliable() {
_ = StructFromDirect()
if (true) {
_ = StructFromDirect()
}
@export(interface)
func nested() {
_ = StructFromDirect()
}
nested()
localInternalFunc()
}
@export(implementation)
public func legalAccessToIndirect() {
_ = StructFromIndirect()
if (true) {
_ = StructFromIndirect()
}
func nested() {
_ = StructFromIndirect()
}
nested()
}
extension Array {
@export(implementation)
public var myMutableSpan: Int {
get {
return 0
}
}
}