Commit Graph

38 Commits

Author SHA1 Message Date
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
Dmitri Gribenko
486cab447d tests: replace 'rm -rf %t && mkdir -p %t' with '%empty-directory(%t)'
These changes were made using a script.
2017-06-04 11:08:39 -07:00
Erik Eckstein
2a55b26e46 Mangling: enable new mangling for symbols 2017-03-16 12:04:08 -07:00
Erik Eckstein
fd62be59a1 stdlib: Use the re-mangler for _typeByName
The old method of constructing a mangled class name does not work anymore with the new mangling scheme.
Also, by using the re-mangler, _typeByName now works with class names containing non-ascii characters.
2017-02-07 08:36:21 -08:00
Joe Groff
2e0cb9c0a2 Runtime: getDynamicType can't drill into existentials when producing a concrete metatype.
For a value of an opaque generic type `<T> x: T`, the language currently defines `type(of: x)` and `T.self` as both producing a type `T.Type`, and the result of substituting an existential type by `T == P` gives `P.Protocol`, so the `type(of:)` operation on `x` can only give the concrete protocol metatype when `x` is an existential in this case. The optimizer understood this rule, but the runtime did not, causing SR-3304.
2016-12-19 11:03:52 -08:00
practicalswift
cc852042c9 [gardening] Fix accidental trailing whitespace. 2016-10-29 10:22:58 +02:00
practicalswift
02d3fcb6ae [gardening] Fix accidental \t 2016-09-25 21:47:34 +02:00
Doug Gregor
cccfe7ab1f [Printing] Print tuple labels when available.
When printing a tuple via print(...), print tuple labels when they are
available. This is possible now that the runtime metadata properly
stores tuple labels. Fixes rdar://problem/23130016.
2016-09-21 09:00:22 -07:00
Dmitri Gribenko
243a35cd65 Migrate callsites from 'expectEmpty()' to 'expectNil()' 2016-09-10 20:05:42 -07:00
Dmitri Gribenko
55864d10cb Tests: use 'mkdir -p' 2016-09-02 21:36:45 -07:00
Max Moiseev
9fc37efee4 [test] renaming test/1_stdlib to just test/stdlib 2016-09-01 16:51:43 -07:00