Files
swift-mirror/test/ParseableInterface/can-import.swift
Harlan Haskins 8b099cd0e7 [ParseableInterface] Add test for #if canImport
This works correclty as-is, but it should be tested.

rdar://48733713
2019-03-20 13:57:16 -07:00

14 lines
469 B
Swift

// RUN: %empty-directory(%t)
// RUN: echo 'public func externalFunc() {}' | %target-swift-frontend -typecheck -emit-parseable-module-interface-path %t/Library.swiftinterface -
// RUN: %target-swift-frontend -typecheck %s -I %t
#if canImport(Library)
import Library
externalFunc()
#else
#error("unable to import Library from its parseable interface")
#endif
#if canImport(LibraryThatDoesNotExist)
#error("should not return true for library that does not exist")
#endif