Files
swift-mirror/test/ScanDependencies/can_import_no_build.swift
Artem Chikin 1b7d55582d Do not build Swift interface files into binary modules when performing a canImport query.
We should hold off actually building the binary module file until it is imported.
`canImport` queries can happen, for example, during dependency scanning, when we do not wish to have the scanner tool execute any module builds.

Resolves rdar://82603098
2021-09-02 12:09:57 -07:00

10 lines
245 B
Swift

// RUN: %target-swift-frontend -c -primary-file %s -Rmodule-interface-rebuild -I %S/Inputs/Swift/
#if canImport(Foo)
print("Can indeed import Foo!")
#else
print("Cannot import Foo!")
#endif
// CHECK-NOT: rebuilding module 'Foo' from interface