Files
swift-mirror/test/Interop/Cxx/implementation-only-imports/check-function-transitive-visibility.swift
Saleem Abdulrasool 357face86e test: introduce new target-swiftxx-frontend for C++ interop
Add an convert to the new `target-swiftxx-frontend` substitution in lit
to control the C++ interop enabling in Swift.  This allows for a single
site which will enable control of both an overridden standard (for
testing multiple C++ standards) and simplify writing tests.
2021-01-12 11:45:36 -08:00

23 lines
1007 B
Swift

// RUN: %empty-directory(%t)
// RUN: mkdir %t/use_module_a %t/use_module_b
// RUN: %target-swiftxx-frontend -enable-library-evolution -swift-version 5 -emit-module -o %t/use_module_a/UseModuleA.swiftmodule %S/Inputs/use-module-a.swift -I %S/Inputs
// RUN: %target-swiftxx-frontend -enable-library-evolution -swift-version 5 -emit-module -o %t/use_module_b/UseModuleB.swiftmodule %S/Inputs/use-module-b.swift -I %S/Inputs
// RUN: %target-swiftxx-frontend -typecheck -swift-version 5 -I %t/use_module_a -I %t/use_module_b -I %S/Inputs %s
// Swift should consider all sources for a decl and recognize that the
// decl is not hidden behind @_implementationOnly in all modules.
// This test, as well as `check-function-transitive-visibility-inversed.swift`
// ensures that Swift looks into the transitive visible modules as well
// when looking for the `getFortyTwo()` decl.
import UseModuleA
@_implementationOnly import UseModuleB
@inlinable
public func callFortyTwo() -> CInt {
return getFortyTwo()
}