Commit Graph

20 Commits

Author SHA1 Message Date
Alex Lorenz
0f9a69c712 android test fixes 2024-05-28 12:59:26 -07:00
Max Desiatov
04b47d7bdc test: mark a few tests as unsupported on Wasm/WASI (#39504)
Certain traps can't be supported on WASI, such as expectations for crashes, `setjmp` use, dynamic linking, multi-threading etc. These tests are marked as `UNSUPPORTED` when targeting Wasm/WASI.
2021-09-29 16:25:38 +01:00
Saleem Abdulrasool
2fc5cbdc14 stdlib: remove swiftMSVCRT, replace with swiftCRT on Windows
This replaces swiftMSVCRT with swiftCRT.  The big difference here is
that the `visualc` module is no longer imported nor exported.  The
`visualc` module remains in use for a singular test wrt availability,
but this should effectively remove the need for the `visualc` module.

The difference between the MSVCRT and ucrt module was not well
understood by most.  MSVCRT provided ucrt AND visualc, combining pieces
of the old MSVCRT and the newer ucrt.  The ucrt module is what you
really wanted most of the time, however, would need to use MSVCRT for
the convenience aliases for type-generic math and the deprecated math
constants.

Unfortunately, we cannot shadow the `ucrt` module and create a Swift SDK
overlay for ucrt as that seems to result in circular dependencies when
processing the `_Concurrency` module.

Although this makes using the C library easier for most people, it has a
more important subtle change: it cleaves the dependency on visualc.
This means that this enables use of Swift without Visual Studio for the
singular purpose of providing 3 header files.  Additionally, it removes
the need for the installation of 2 of the 4 support files.  This greatly
simplifies the deployment process on Windows.
2020-10-15 16:02:01 -07:00
Robert Widmann
cddf73ecdb [Gardening] Clean Up OS-Test Patterns Across The Codebase
Clean up a few general patterns that are now obviated by canImport

This aligns more generally with the cleanup that the Swift Package
Manager has already done in their automated XCTest-plumbing tool in
apple/swift-package-manager#1826.
2020-06-30 22:55:58 -07:00
Slava Pestov
23cac673ca IRGen: Enable dynamic replacement with library evolution
It looks like the only thing that fails is the linkage computation
for the dynamic replacement key of class methods. Even though
methods have hidden linkage to prevent them from being directly
referenced from outside a resilient module, we need to ensure
the dynamic replacement key is visible.

Fixes <rdar://problem/58457716>.
2020-04-10 22:53:36 -04:00
Slava Pestov
120840e092 Fix formatting nits in test/Interpreter/dynamic_replacement.swift 2020-04-10 18:45:07 -04:00
Slava Pestov
dd271cd089 Add test cases for initializer replacement to test/Interpreter/dynamic_replacement.swift 2020-04-10 18:45:07 -04:00
3405691582
4a36a4b6c5 [test] Setup testing for OpenBSD.
This commit focuses the basics: setting up the relevant stanzas in
lit.cfg and adding platform conditionals for importing Glibc. Future
commits will deal with other portability fixes.
2020-03-23 20:47:31 -04:00
Arnold Schwaighofer
1b863d6787 Allow final on dynamic members
Dynamic is about dynamically replacing a method implementiation not
overriding.

rdar://49535048
2019-04-04 07:26:43 -07:00
Daniel Rodríguez Troitiño
d08b46c47e [tests] Standarize the checks for Darwin, Glibc and MSVCRT.
Different tests used different os checks for importing Darwin, Glibc and
MSVCRT. This commit use the same pattern for importing those libraries,
in order to avoid the #else branches of the incorrect patterns to be
applied to the wrong platform. This was very normal for Android, which
normally should follow the Linux branches, but sometimes was trying to
import Darwin or not importing anything.

The standarized pattern imports Darwin for macOS, iOS, tvOS and watchOS.
It imports Glibc for Linux, FreeBSD, PS4, Android, Cygwin and Haiku; and
imports MSVCRT for Windows. If a new platform is introduced, the else
branch will report an error, so the new platform can be added to one of
the branches (or maybe add a new specific branch).

In some cases  the standard pattern was modified because some test required
it (importing extra modules, or extra type aliases), and in some other
cases some branches were removed because the test will not have used
them (but it is not exhaustive, so there might be some unnecessary
branches).

This should, at least, fix three tests for Android (the three
dynamic_replacement*.swift ones).
2019-02-06 10:51:55 -08:00
Arnold Schwaighofer
d05629782f Fix dynamic_replacement test on devices
We need the absolute path to the dylib
2019-01-22 13:53:04 -08:00
Saleem Abdulrasool
d2aad4121c test: port most of the interpreter tests to Windows
This ports most of the interpreter tests to Windows.  A few remaining
failures need to be diagnosed still.
2019-01-15 18:47:13 -08:00
Saleem Abdulrasool
d77801abaf test: define and use %target-rpath
Create a new capturing substitution for adding a rpath to a target
library.  This is needed as Windows doesn't really support the concept
of a rpath.  This also makes it possible to remove the parameter from
the command line on windows.
2018-12-12 19:51:08 -08:00
Saleem Abdulrasool
ed1ec54958 test: make %target-library-name work in captures
Thanks to @jrose for the hint about the substitution ordering, the new
substitution now works even inside the capture group.  Replace the
remaining uses to the new macro.
2018-12-12 10:09:58 -08:00
Saleem Abdulrasool
8968fcad5f test: create and use target-library-name 2018-12-12 08:37:59 -08:00
Saleem Abdulrasool
b212229db1 test: add and use prefix substitutions for libraries
The naming convention is different on Windows than on Unix-like
environments.  In order to follow the convention we need to substitute
the prefix and the suffix.  Take the opportunity to rename the
`target-dylib-extension` to the CMake-like variable
`target-shared-library-suffix` and introduce
`target-shared-library-prefix`.  This helps linking the test suite
binaries on Windows.
2018-12-11 15:56:06 -08:00
Arnold Schwaighofer
081bb95bee Synthesize accessors for dynamic global variables 2018-11-14 07:57:45 -08:00
Arnold Schwaighofer
28da6b1075 Sema: Don't add dynamic to dynamic replacement decls
They can't be dynamic.

Add test for enable-implicit-dynamic flag.
2018-11-13 09:36:54 -08:00
Arnold Schwaighofer
693c5f4d94 Fix test on devices
rdar://45913026
2018-11-08 11:28:20 -08:00
Arnold Schwaighofer
152e8db8bb IRGen and runtime implementation for dynamic replacements 2018-11-06 09:58:36 -08:00