Commit Graph

665 Commits

Author SHA1 Message Date
Ben Rimmington
682c1672b6 [stdlib] Update file headers of de-gybbed files 2020-04-01 22:14:03 +01:00
Dave Abrahams
fd48f8fa96 Squash warnings 2020-03-27 14:53:22 -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
Nate Chandler
2b606909d4 Disabled Result_future on another simulator.
The test cannot run on simulator since it requires a "future" target--in
this case watchOS 9.99 which is inherently beyond what any simulator is
running.
2020-02-22 21:02:44 -08:00
nate-chandler
de660ceea4 Merge pull request #29885 from nate-chandler/generic-metadata-prespecialization-components/stdlib-on
[metadata prespecialization] Always on for stdlib.
2020-02-17 15:04:59 -08:00
Nate Chandler
4475f43ba0 [metadata prespecialization] Always on for stdlib.
Regardless of any flags, the stdlib will have its generic metadata
prespecialized.

Temporarily reintroduced the flag to enable the feature flag while
preserving the flag to disable it and changed the default back to off
for the moment.
2020-02-17 11:53:27 -08:00
Nate Chandler
da3a393e64 Reenable temporarily disabled test.
The test relies on new runtime functionality that is by definition not
available in the stdlib in the OS.  Here, the test is marked as
unsupported run running using the OS' stdlib.

rdar://problem/59425215
2020-02-13 09:44:21 -08:00
nate-chandler
8c92cfd42c Temporarily disable Result_future.swift test. (#29809)
Reenabling the test is tracked by rdar://problem/59425215 .
2020-02-13 18:26:06 +01:00
Stephen Canon
0174f5dbd0 Mark Prototypes/Result_future.swift unsupported on tvOS simulator. (#29808) 2020-02-13 17:57:18 +01:00
Nate Chandler
40e17d9c6f [metadata prespecialization] Direct refs to enums.
When a specialized usage of a generic enum occurs in the same module
where the enum was defined, directly reference the prespecialized
metadata.

rdar://problem/56994321
2020-02-12 10:08:33 -08:00
Dave Abrahams
896d4fca0c Add efficiency docs for partitionPoint 2020-01-04 15:01:15 -08:00
Nate Cook
2e6f8655cb [test] Make concatenation work for sequences, too. 2019-08-22 10:38:35 -05:00
Arnold Schwaighofer
b31b7a9d8e Remove some UNSUPPORTED swift_test_mode_optimize_none_with_implicit_dynamic
rdar://51228899
2019-05-31 08:45:37 -07:00
Ben Cohen
e9d4687e31 De-underscore @frozen, apply it to structs (#24185)
* De-underscore @frozen for enums

* Add @frozen for structs, deprecate @_fixed_layout for them

* Switch usage from _fixed_layout to frozen
2019-05-30 17:55:37 -07:00
Sho Ikeda
a35c9f0c60 [gardening] Use Collection.isEmpty over Collection.count 2019-05-26 09:35:20 +09:00
Michael Gottesman
da37a56896 [sil] Change the immutable address use verifier to ignore br/cond_br uses that introduce address phis and re-enable the test that shows this behavior.
We want to eventually remove address phi arguments from SIL. This will enable
all sorts of nice IRGen optimizations and in general make life better. We are
not there yet, but given that is the direction we are going in, I don't think
there is much use in having to implement this sort of checking for SIL phi
arguments.

rdar://50676315
2019-05-11 14:37:11 -07:00
Brent Royal-Gordon
08bd6bd715 Disable Prototypes/TextFormatting everywhere 2019-05-10 16:58:58 -07:00
Brent Royal-Gordon
387fc08e6c Disable Prototypes/TextFormatting in 32-bit
The new ImmutableAddressUseVerifier asserts when it tries to compile it. rdar://problem/50676315
2019-05-10 14:26:28 -07:00
Arnold Schwaighofer
e113ef8c93 Add a mode to test implicit dynamic with private imports 2019-03-20 14:34:01 -07:00
Pavol Vaskovic
babb97eb87 [Gardening] How to ressurect tests and benchmark 2019-03-01 20:53:01 +01: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
d4a1865e00 test: Prototypes changes for Windows
Mark a test as XFAIL and port the other one to Windows and enable on
Linux.
2019-01-13 22:09:02 -08:00
Maxim Moiseev
165fe328c3 [stdlib] tee _stdlib_AtomicInt > SwiftPrivate
Turns out some people used this type despite it being prefixed with
`_stdlib_`, so we have to keep it, with an obsoletion message this time.
Second copy of the same type is kept available past Swift 5 in
SwiftPrivate for use in tests.
2018-12-18 16:12:47 -08:00
Slava Pestov
aa747dcd81 Remove property behaviors 2018-12-07 20:38:33 -05:00
Karoy Lorentey
666a22feff [test] Modernize hashing throughout the test suite 2018-11-29 17:38:29 +00:00
Ben Cohen
df2307e035 [stdlib][DNM] Collapse sequence and collection wrappers (#20221)
* Concretize dropFirst/Last/sufix/prefix from Sequence

Remove split customization point

Eliminate SubSequence from Sequence protocol

Collapse LazyCollection

Collapse LazyMapCollection

Eliminate _SequenceWrapper

Collapse LazyFilterCollection

Collapse LazyDrop/PrefixWhileCollection

Fix tests, ABI stability update

Collapse FlattenSequence

* Add entries to source/ABI compatible expected results.

* Update tests to avoid pre-10.14 objc runtime bug

* Expunge _preprocessingPass
2018-11-14 10:05:58 -08:00
Michael Ilseman
4ddfd30787 [stdlib] Remove dead code 2018-11-09 13:39:59 -08:00
Nate Cook
e5c1567957 [stdlib] Switch to a stable sort algorithm (#19717)
This switches the standard library's sort algorithm from an in-place
introsort to use a modified timsort, a stable, adaptive sort that
merges runs using a temporary buffer. This implementation performs
straight merges instead of adopting timsort's galloping strategy.

In addition to maintaining the relative order of equal/non-comparable
elements, this algorithm outperforms the introsort on data with any
intrinsic structure, such as runs of ascending or descending elements
or a significant number of equality collisions.
2018-11-07 00:05:04 -06:00
Maxim Moiseev
ca51626fd3 [stdlib] Move _stdlib_AtomicInt and friends out of the stdlib 2018-11-06 09:53:58 -08:00
John McCall
abdba1d3f4 Change the integer-literal type from Int2048 to IntLiteral.
Part of SR-290.
2018-10-31 23:14:58 -04:00
Doug Gregor
1f2f90e731 [Test] Update test to Swift 4 2018-10-19 14:15:45 -07:00
Doug Gregor
0a8058ca6a [Integer protocols] Make BinaryInteger.Words conform to RandomAccessCollection.
Require that BinaryInteger.Words conform to RandomAccessCollection with
an Index type of Int, simplifying clients.

Fixes rdar://problem/36410936.
2018-09-05 16:22:27 -07:00
Stephen Canon
190c7d6b9f Default implementation of isMultiple(of:) on BinaryInteger
In order to provide source compatibility with existing user types conforming to BinaryInteger, we want to have a default implementation available. It's somewhat difficult to provide a good default implementation that correctly handles arbitrary non-symmetrical ranges in the face of negative divisors, so fall back on testing divisibility of the magnitudes, which avoids the problem.

On the plus side, this default implementation works fine for types conforming to UnsignedInteger, which lets us move the FixedWidthInteger implementation down to FixedWidthInteger & SignedInteger, and simplify it in the process.
2018-09-04 16:32:14 -04:00
Stephen Canon
c1f25e0673 [SE-0225] Implementation of isMultiple for BinaryInteger. (#18689)
* Implement SE-0225 (BinaryInteger.isMultiple(of:))

A default implementation is provided for FixedWidthInteger, with very basic test coverage included.
2018-09-04 10:31:05 -04:00
Arnold Schwaighofer
294edf532c Codesign test/Prototypes 2018-08-10 06:58:40 -07:00
Ben Rimmington
2f326bcc88 [stdlib] Remove theGlobalMT19937
SwiftPrivate/PRNG.swift:

- currently uses `theGlobalMT19937`;
- previously used `arc4random` (see #1939);
- is obsoleted by SE-0202: Random Unification.
2018-08-01 13:00:16 +01:00
Ben Cohen
345879429b [stdlib] Take several underscored stdlib functions private (#18134)
* Make _sanityCheck internal

* Make _debugPrecondition internal

* Make Optional._unsafelyUnwrappedUnchecked internal.

* Make _precondition internal

* Switch Foundation _sanityChecks to assertions

* Update file check tests

* Remove one more _debugPrecondition

* Update Optimization-with-check tests
2018-07-24 18:26:19 -07:00
Ben Cohen
f62c2c9fa3 Sink down the internal word index enum, fiddle with some switches 2018-07-16 09:06:37 -07:00
Ben Cohen
1d80829f4d Synthesize DoubleWidth.Words.Index Equatable conformance 2018-07-16 09:06:37 -07:00
Ben Cohen
5fcf4dd3c7 Break out DoubleWidth.Words.Index conformances 2018-07-16 09:06:37 -07:00
Ben Cohen
38214cce31 Break out DoubleWidth.Words.Index declaration 2018-07-16 09:06:37 -07:00
Ben Cohen
4fa63880be Break out DoubleWidth.Words declaration from Collection conformance 2018-07-16 09:06:37 -07:00
Ben Cohen
8540f59d16 Break out DoubleWidth.Words from FixedWidthInteger extension 2018-07-16 09:06:37 -07:00
Ben Cohen
3ac0ef73aa Remove _frozen from _IndexValue 2018-07-16 09:06:37 -07:00
Ben Cohen
e848e559bf Break out Equatable and Comparable conformance 2018-07-16 09:06:37 -07:00
Ben Cohen
4cd964a7be Remove inlinability etc from DoubleWidth 2018-07-16 09:06:37 -07:00
Ben Cohen
b77b544cdc Remove remaining @ininable from @_transparent (#17968) 2018-07-16 08:12:52 -07:00
Ben Cohen
a6952decab [stdlib] Remove inlineable annotation from transparent functions (#17800)
* Remove inlineable annotation from transparent functions
2018-07-07 08:47:02 -07:00
Rintaro Ishizaki
622a140adb Merge pull request #17796 from rintaro/parse-drop3-tests
[Parse] Migrate tests to Swift4
2018-07-07 23:25:11 +09:00
Rintaro Ishizaki
5cbbadb750 [Parse] Migrate tests to Swift4 2018-07-07 01:29:43 +09:00