If a `.swiftinterface` file does not include an explicit `-language-mode`
option (or its predecessor `swift-version`) and needs to be built as a
dependency of a client compilation, then the invocation to build the module
from interface would end up inheriting the language mode that the client code
is built with. This can result in spurious type checking diagnostics or even
mis-compilation. To ensure that a module interface is always built using the
language mode that its source code was originally built with, require an
explicit `-language-mode` option when emitting swiftinterface files.
Resolves rdar://145168219.
Explicitly disable batch mode in createCompilerInvocation, since it uses
-force-single-frontend-invocation. Previously we were getting spurious
warnings. Also add a test that -disable-batch-mode will allow commands
that use -index-file to avoid the same warning, since that is likely
what they want to do as well.
rdar://39581506
Doing so is safe even though we have mock SDK. The include paths for
modules with the same name in the real and mock SDKs are different, and
the module files will be distinct (because they will have a different
hash).
This reduces test runtime on OS X by 30% and brings it under a minute on
a 16-core machine.
This also uncovered some problems with some tests -- even when run for
iOS configurations, some tests would still run with macosx triple. I
fixed the tests where I noticed this issue.
rdar://problem/19125022
Swift SVN r23683
This is very basic: it just sees whether, given a set of driver arguments, the
swift::driver::createCompilerInvocation API returns a non-null
CompilerInvocation.
Unlike other modes of swift-ide-test, this mode requires that
"-test-createCompilerInvocation" be the first argument passed to swift-ide-test.
This is because it is handled separately from llvm::cl::ParseCommandLineOptions
so the remaining arguments can be passed through directly to
swift::driver::createCompilerInvocation without any interference from that
parser.
Additionally, added a test which uses this tool to try to create a
CompilerInvocation for a handful of basic driver commands.
Swift SVN r20973