Commit Graph

16 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
3405691582
5847726f51 Preliminary support for OpenBSD in the stdlib.
These should hopefully all be uncontroversial, minimal changes to deal
with progressing the build to completion on OpenBSD or addressing minor
portability issues. This is not the full set of changes to get a
successful build; other portability issues will be addressed in future
commits.

Most of this is just adding the relevant clauses to the ifdefs, but of
note in this commit:

* StdlibUnittest.swift: the default conditional in _getOSVersion assumes
  an Apple platform, therefore the explicit conditional and the relevant
  enums need filling out. The default conditional should be #error, but
  we'll fix this in a different commit.

* tgmath.swift.gyb: inexplicably, OpenBSD is missing just lgammal_r.
  Tests are updated correspondingly.

* ThreadLocalStorage.h: we use the pthread implementation, so it
  seems we should typedef __swift_thread_key_t as pthread_key_t.
  However, that's also a tweak for another commit.
2020-03-01 12:50:06 -05:00
Max Desiatov
88ad780419 Fix a few tests for WASI 2020-02-16 21:16:01 +00:00
Stephen Canon
d80b1d39a3 Backout SE-0246 (#26809)
* Revert "Add availability information to the new Math function protocols (#24187)"

This reverts commit d2f695935f.

* Revert "SE-0246: Protocols and static functions (#23824)"

This reverts commit 57a4553832.

* Expected abi changes.
2019-08-23 16:41:17 -04:00
Stephen Canon
57a4553832 SE-0246: Protocols and static functions (#23824)
This implements the protocols and static functions proposed in SE-0246, plus some initial test coverage. It also has some rough accompanying cleanup of tgmath. It does not include the globals (on scalars or SIMD types) nor does it deprecate much in tgmath.h.
2019-04-17 23:57:33 +02:00
Stephen Canon
c5e3f85378 Revert SE-0246 (#23800)
* Revert "Merge pull request #23791 from compnerd/you-know-nothing-clang"

This reverts commit 5150981150, reversing
changes made to 8fc305c03e.

* Revert "Merge pull request #23780 from compnerd/math-is-terrible"

This reverts commit 2d7fedd25f, reversing
changes made to 0205150b8f.

* Revert "Merge pull request #23140 from stephentyrone/mafs"

This reverts commit 777750dc51, reversing
changes made to 0c8920e747.
2019-04-04 19:35:25 -04:00
Steve (Numerics) Canon
2bc6040556 More test fixup for Linux. 2019-04-03 09:32:44 -04:00
Steve (Numerics) Canon
0c7c1f0365 Update tgmath.swift.gyb to work with Glibc and MSVCRT. 2019-04-03 08:17:05 -04:00
Steve (Numerics) Canon
10fd131964 Test fixes. 2019-04-02 18:49:31 -04:00
Steve (Numerics) Canon
3fda509805 Implementation of ElementaryFunctions / Real protocols.
This commit implements SE-0246, by adding conformance to Real to the Float, CGFloat, Double, and Float80 types, implemented either in terms of the system's C math library, existing standard library functionality, or LLVM intrinsics. It includes basic test coverage for these new functions, and deprecates and obsoletes *some* existing functionality in the Platform overlay. We still need to make a decision about how to handle the remaining "tgmath" functions, because obsoleting them is technically a source-breaking change (if users have unqualified names like "exp(1)", it's fine, but it would break users who have used qualified names like "Darwin.exp(1)".)
2019-04-02 18:49:31 -04: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
Arnold Schwaighofer
2d8a1dbbfe Codesign test/stdlib 2018-08-10 06:58:40 -07:00
Stephen Canon
d3cb915abb Updates to tgmath functions for CGFloat (#15360)
* Updates to tgmath functions for CGFloat

These changes bring CGFloat in line with the other FloatingPoint types.  Some of this stuff is now defined at the protocol level, so we can get rid of it at the concrete type level.  A couple other functions have been deprecated for all types, with protocol or tgmath replacements.
2018-03-20 11:14:57 -04:00
Stephen Canon
ba97a32cfc Skip testing remoquo for Linux + x86_64, because it's busted. (#15348)
Further details and discussion of longer-term fix in SR-7234.
2018-03-19 18:46:01 -04:00
Stephen Canon
ff7dde6230 Make tgmath tests generic over TGMath protocol, extend to Float80 (#15289)
* Make tgmath tests generic over a TGMath protocol, extend them to Float80.

Define most of the test machinery in terms of a internal TGMath protocol that refines BinaryFloatingPoint. Add a little bit of gyb support to automate adding additional types, as it is likely these tests will need to support Float16 and Float128 in the future. Make all the input values exactly representable in all of the types in question, to avoid representation errors, loosen default tolerance to 3 to make porting to new platforms less noisy.

* Further tgmath test cleanup.

Merge #if conditions where possible so that they're not all over the file. Get rid of placeholder CGFloat on non-Darwin, which is no longer needed and doesn't work with the new approach anyway.

* Remove ldexp, it's been renamed scalbn.
2018-03-17 11:38:50 -04:00