Commit Graph

60 Commits

Author SHA1 Message Date
Daniel Rodríguez Troitiño
ba68faaed5 [test] Mark tests that use experimental/upcoming features as such
Find all the usages of `--enable-experimental-feature` or
`--enable-upcoming-feature` in the tests and replace some of the
`REQUIRES: asserts` to use `REQUIRES: swift-feature-Foo` instead, which
should correctly apply to depending on the asserts/noasserts mode of the
toolchain for each feature.

Remove some comments that talked about enabling asserts since they don't
apply anymore (but I might had miss some).

All this was done with an automated script, so some formatting weirdness
might happen, but I hope I fixed most of those.

There might be some tests that were `REQUIRES: asserts` that might run
in `noasserts` toolchains now. This will normally be because their
feature went from experimental to upcoming/base and the tests were not
updated.
2024-11-02 11:46:46 -07:00
Allan Shortlidge
6fb6a56b20 SILGen: Introduce macCatalyst support for if #available.
Upstream the necessary changes to compile `if #available` queries correctly
when a `macabi` target triple or a `-target-variant` is specified.
2024-07-23 17:00:10 -07:00
Alex Lorenz
95209ca468 update tests to use canImport(android) and make libc test for generalized 2024-05-28 13:01:15 -07:00
Alex Lorenz
0f9a69c712 android test fixes 2024-05-28 12:59:26 -07:00
Artem Chikin
1f14158a1d Introduce VisionOS Platform
This change introduces a new compilation target platform to the Swift compiler - visionOS.

- Changes to the compiler build infrastrucuture to support building compiler-adjacent artifacts and test suites for the new target.
- Addition of the new platform kind definition.
- Support for the new platform in language constructs such as compile-time availability annotations or runtime OS version queries.
- Utilities to read out Darwin platform SDK info containing platform mapping data.
- Utilities to support re-mapping availability annotations from iOS to visionOS (e.g. 'updateIntroducedPlatformForFallback', 'updateDeprecatedPlatformForFallback', 'updateObsoletedPlatformForFallback').
- Additional tests exercising platform-specific availability handling and availability re-mapping fallback code-path.
- Changes to existing test suite to accomodate the new platform.
2024-04-10 09:38:02 -07:00
Yuta Saito
79b3d2d626 Add underscore prefix to extern attribute
It's already guarded by a feature flag, but it would be nice to signal
users that it's not stable yet by adding an underscore prefix.
2023-11-07 02:01:02 +00:00
Yuta Saito
b49e99a206 [test][stdlib] Fix calling convention mismatch in test/stdlib/Runtime.swift.gyb
`swift_demangle` is defined with C calling convention, but the test case
used SwiftCC.
2023-10-24 01:35:25 +00:00
Karoy Lorentey
b82ce9c3be [stdlib] Adopt _pointerBitWidth conditional 2023-04-27 13:33:24 -07:00
Alsey Coleman Miller
62b7be4e9c [stdlib] Add RISCV64 support 2022-11-01 23:59:42 -07:00
Anthony Latsis
52ce15ee9d Gardening: Migrate test suite to GH issues: stdlib 2022-09-22 03:21:39 +03:00
Alastair Houghton
729b75755a [Tests][Runtime] Update availability test for demangleTruncate.
The fix for this issue didn't ship in 10.15, so testing it there just
causes a build failure.

rdar://87181765
2022-09-06 12:43:11 +01:00
Doug Gregor
c76a99ba02 [SE-0352] Enable implicit opening of existentials by default 2022-04-20 17:51:04 -07:00
Alsey Coleman Miller
0ab3eec987 Added PowerPC 32-bit support 2022-03-03 22:21:33 -05:00
Max Desiatov
372ada0e24 test: add handling for Wasm/WASI (#39519)
This change adds support for WASI in stdlib tests. Some tests that expect a crash to happen had to be disabled, since there's currently no way to observe such crash from a WASI host.
2022-01-12 14:24:50 +00:00
Devin Coughlin
3abd7b0e1f Add a targetOSVersionAtLeast builtin.
This allows the compiler to parse the Swift swiftinterface file of a recent SDK.
2021-11-22 11:59:56 +01:00
Kuba (Brecka) Mracek
8b189d99e4 Turn off SWIFT_ENABLE_REFLECTION on the stdlib_minimal preset (#39030) 2021-09-12 18:54:53 -07:00
Robert Widmann
0149ccd0ca Add arm64_32 support for Swift
Commit the platform definition and build script work necessary to
cross-compile for arm64_32.

arm64_32 is a variant of AARCH64 that supports an ILP32 architecture.
2021-04-20 14:59:04 -07:00
Dave Lee
8ac54a5bde [runtime] Remove unused lldb symbols 2021-02-24 18:11:50 -08:00
Luciano Almeida
c29fbb5528 [test] Adjusting test files where class syntax is used for protocol inheritance 2020-11-29 21:43:50 -03:00
Kuba (Brecka) Mracek
d7dfa3e942 Bring up tests + validation tests for the 'freestanding' build and the standalone_minimal preset (#34386) 2020-10-26 16:32:36 -07: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
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
Max Desiatov
88ad780419 Fix a few tests for WASI 2020-02-16 21:16:01 +00:00
Mike Ash
b8f5e841e2 [Runtime] Add a function pointer for intercepting swift_willThrow calls.
rdar://problem/53400364
2019-10-24 14:06:14 -04:00
Mike Ash
9ae7141711 [Test] Modify Runtime.swift.gyb to only test 9999 availability when running against a runtime that isn't part of the OS.
rdar://problem/55727341
2019-09-30 11:00:33 -04:00
Mike Ash
33b7c04842 [Test] Disable the Runtime.demangleTruncate test on older OSes so it doesn't fail in back deployment testing.
rdar://problem/52357361
2019-07-08 15:34:13 -04:00
Azoy
9bbb85323a add demangle truncate test 2019-06-09 13:54:10 -05:00
Mike Ash
de805c0112 [Stdlib] Special-case major version 9999 as always available.
rdar://problem/43776049
2019-02-15 16:23:03 -05: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
Saleem Abdulrasool
7ca074bd07 test: port most of the stdlib tests to Windows
This adjusts the standard library test suite to mostly pass on Windows.
The remaining failures are due to various cases:

- memory corruption (`_swift_stdlib_free` in swiftDemangle)
- heap corruption (canGrowUsingRealloc)
- withVAList failure (unresolved)
- unicode handling on the command line
2019-01-15 09:19:06 -08:00
Mike Ash
2114ce011e [Runtime] Fix incorrect cast in NonFixedExistentialMetatypeBox::Container::getNumWitnessTables.
The incorrect cast led to absurd values for getNumWitnessTables which then caused crashes (or worse?) down the line.

SR-8158 rdar://problem/41725205
2018-12-07 09:51:12 -05:00
Azoy
a2dafc3d26 Remove _getBool 2018-12-01 18:51:25 -06:00
levivic
44c7a827ac Fix Runtime.swift.gyb failur. 2018-11-02 10:46:31 -04:00
Daniel Rodríguez Troitiño
e1908d71c9 [android] Force parsing of literal as unsigned.
0xffffffff do not fit into Int, and even if it doesn't, Swift
doesn't change the default to be UInt and fit, so we have to
be explicit.
2018-10-19 12:32:47 -07:00
Daniel Rodríguez Troitiño
c69f082e3c [android] Make some stdlib tests in Android follow Linux branches. 2018-10-10 16:01:36 -07:00
Mike Ash
e18e03171f [Stdlib] Change SWIFT_RUNTIME_STDLIB_INTERNAL to not export the symbol.
The functions in LibcShims are used externally, some directly and some through @inlineable functions. These are changed to SWIFT_RUNTIME_STDLIB_SPI to better match their actual usage. Their names are also changed to add "_swift" to the front to match our naming conventions.

Three functions from SwiftObject.mm are changed to SPI and get a _swift prefix.

A few other support functions are also changed to SPI. They already had a prefix and look like they were meant to be SPI anyway. It was just hard to notice any mixup when they were #defined to the same thing.

rdar://problem/35863717
2018-10-03 09:55:33 -04:00
Erik Eckstein
39bb14b094 change mangling prefix from $S to $s
This is the final ABI mangling prefix

rdar://problem/38471478
2018-09-19 13:55:11 -07:00
Ben Cohen
293da8fa3e [stdlib] YAIAPR (#18956)
* Scrap Comparable conformance for _SwiftNSOperatingSystemVersion

* Lazy performance needs specialization

* Uninline dump/stdout

* Bool consistency

* fixup CollectionOld

* Uninline printing functions
2018-08-24 14:00:19 -07:00
Arnold Schwaighofer
2d8a1dbbfe Codesign test/stdlib 2018-08-10 06:58:40 -07:00
Slava Pestov
c86d797c85 stdlib: Move Mirrors tests from Runtime.swift.gyb to Mirror.swift 2018-04-20 21:55:45 -07:00
Sho Ikeda
b68be20e9d [test][gardening] Prefer os(macOS) over os(OSX) 2018-03-11 10:58:58 +09:00
Pavel Yaskevich
7a7825ff50 [Runtime/Reflection] Switch enum mirrors to use runtime get field method 2018-02-20 18:20:09 -08:00
Xiaodi Wu
d7ab0aab20 Remove tests for obsolete miscellany 2018-02-02 10:02:07 -06:00
Slava Pestov
4af7b84170 Runtime: Fix memory leak in swift_EnumCaseName()
If the value was wrapped in an existential buffer, we would never
release the original value even though it was passed in at +1.

Fixes <rdar://problem/36153982>, <https://bugs.swift.org/browse/SR-6536>.
2018-01-07 22:40:13 -08:00
Erik Eckstein
cd3d50a5d9 ABI: Change the mangling prefix from _T0 to $S 2018-01-06 13:55:59 -08:00
Greg Parker
da14cd79a6 [runtime] Clean up symbol exports in libc functions. (#13202) 2017-12-01 17:49:11 -08:00
Alex Hoppen
1c7e289b96 [Mangling] Adjust subscript mangling to not include "subscript"
Change the mangling of accessors to have a variable or subscript node
as their only child node, while subscript nodes no longer contain a decl
name.
2017-09-10 19:44:07 +02:00
Joe Shajrawi
66d0df6bae Revert "Temporary disable failing armv7 tests"
This reverts commit 78e5e25215.
2017-08-15 13:43:57 -07:00
Joe Shajrawi
78e5e25215 Temporary disable failing armv7 tests 2017-08-08 15:22:14 -07:00