Commit Graph

14 Commits

Author SHA1 Message Date
Mishal Shah
92ca9fc924 [Apple Silicon] Generalize tests for other macOS architectures
Most of the changes fall into a few categories:
* Replace explicit "x86_64" with %target-cpu in lit tests
* Cope with architecture differences in IR/asm/etc. macOS-specific tests
2020-07-02 16:27:46 -07:00
3405691582
c8ba437444 [test] Handle architecture aliasing for OpenBSD.
Swift calls the architecture x86_64, OpenBSD calls it amd64. If we use
run_cpu in lit.cfg as-is, then we may need to duplicate lines in each
test for 'x86_64' and 'amd64', which puts a maintenance burden on unit
test developers to ensure they are duplicating changes to each line.

Instead, alias 'amd64' to 'x86_64' for `run_cpu`, but keep the platform
module path referring to 'amd64', in order to distinguish the target
architecture name and the Swift architecture name. This is particularly
relevant for the %target-.*-name pseudovariables used, which should
reference the Swift architecture names.

However, some unit tests are directly referencing %target-cpu directly,
which would break the aliasing. This is done only for swiftinterface
files, so a new substitution is defined in lit.cfg for these variables,
and the affected unit test cases are migrated.
2020-06-12 21:06:37 -04:00
Varun Gandhi
a1716fe2a6 [Diagnostics] Update compiler diagnostics to use less jargon. (#31315)
Fixes rdar://problem/62375243.
2020-04-28 14:11:39 -07:00
Brent Royal-Gordon
e7bd60494a Revert "[ModuleLoader] Emit a better diagnostic for swiftinterfaces with wrong arch."
This reverts commit 412ee0a922.
2020-04-24 13:45:05 -07:00
Doug Gregor
94e9153878 Merge pull request #31170 from DougGregor/build-module-triples
[CMake] Use proper module triples for the names of standard library modules
2020-04-23 23:57:50 -07:00
Varun Gandhi
412ee0a922 [ModuleLoader] Emit a better diagnostic for swiftinterfaces with wrong arch.
Before this change, we would emit the warning only for swiftmodules; however,
it may be the case that only a swiftinterface (of a different arch) is present
but no swiftmodule is present.

Fixes rdar://problem/50905075.
2020-04-22 23:58:54 -07:00
Doug Gregor
b27b4d4bb6 [CMake] Use proper module triples for the names of standard library modules.
The standard library (and other Swift modules built by our CMake build system)
has been building module files with an architecture only (e.g., x86_64.swiftmodule)
rather than a proper module triple (x86_86-apple-macosx10.15,
x86_64-apple-ios13.0-simulator, etc.), unlike every other build
system. There are hacks in the compiler and other tools to cope with
this unnecessary build difference. Fix the module file names so we'll
be able to remove the hacks later.

Fixes rdar://problem/49071536.
2020-04-20 21:16:14 -07:00
Brent Royal-Gordon
a7a5e340aa Improve diagnostic for broken module interfaces
Currently, when a swiftinterface file fails to load, we emit the specific diagnostics for the failures, followed by a generic “failed to load module ‘Foo’” message. This PR improves that final diagnostic, particularly when the cause may be that the interface was emitted by a newer compiler using backwards-incompatible syntax.
2020-03-13 20:31:55 -07:00
Arnold Schwaighofer
3a520e674e Disable test that fails spuriously
This test fails sometimes with something like:

SOURCE_DIR/test/ModuleInterface/ModuleCache/prebuilt-module-cache-forwarding.swift:47:8: error: malformed compiled module: BUILD_DIR/test-macosx-x86_64/ModuleInterface/ModuleCache/Output/prebuilt-module-cache-forwarding.swift.tmp/MCP/Lib-2XZQCTV44N470.swiftmodule

rdar://58578342
2020-01-15 06:04:41 -08:00
Michael Gottesman
269762eee3 [ownership] Enable ownership lowering /after/ the diagnostic passes.
I also updated the last group of straggling tests.
2019-11-17 11:34:43 -08:00
Daniel Rodríguez Troitiño
eaae6f73d7 XFAIL SDKDependencies test in Windows.
Windows paths attack again. Some paths from the dependency tracker have
mixed folder separators, so comparing textually fail. Additionally some
paths seems to be extended paths (\\?\) which seems not to be liked by
LLVM path utilities.
2019-10-17 10:09:51 -07:00
Varun Gandhi
903add2c3f [Frontend] Make the module trace emission more robust.
✔ More informative error messages in case of crashes.
✔ Handling and documenting different cases.
✔ Test cases for different cases.
✔ Make SDKDependencies.swift pass again.
2019-10-15 15:44:26 -07:00
Varun Gandhi
f969320883 Emit traces related to sdk dependencies and mark test case failing.
Exposes the issue in rdar://problem/55752426.
2019-10-11 17:23:07 -07:00
Harlan Haskins
d3b8ce7ae2 [test] Update ParseableInterface to ModuleInterface
Also remove uses of -emit-parseable-module-interface from tests
2019-09-13 14:55:48 -07:00