Commit Graph

2011 Commits

Author SHA1 Message Date
Michael Ilseman
a742a62c18 [String] Use the new value in utf8 setter.
ð
2019-02-06 15:11:17 -08: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
Karoy Lorentey
2c8a55f8eb [test] Regenerate Collection validation tests 2019-02-01 18:33:30 -08:00
Karoy Lorentey
33a8962d5e [test] Fix bitrot in Collection validation test gyb 2019-02-01 18:33:29 -08:00
Karoy Lorentey
52f2b0a901 [test] Require optimized stdlib for Collection validation tests
These take too long to run with unoptimized stdlib builds, causing timeout issues.

rdar://problem/46878013
2019-02-01 18:33:29 -08:00
Mishal Shah
cc78af105f Merge pull request #22274 from apple/update-master-xcode-10.2-beta-1
Update master to build with Xcode 10.2 beta 1
2019-02-01 16:30:58 -08:00
Ben Cohen
95a15d12bd Revert count(where:) (#22289) 2019-02-01 15:05:06 -08:00
Max Moiseev
556e089d19 Merge pull request #22138 from moiseev/spring-cleaning
[stdlib] Remove a bunch of declarations marked as obsoleted in 4
2019-02-01 11:03:37 -08:00
Ben Cohen
779ea19a6a Revert count(where:) 2019-01-31 18:57:17 -08:00
Mishal Shah
42633218c5 Update master to build with Xcode 10.2 beta 1 2019-01-31 14:48:29 -08:00
Maxim Moiseev
9a81ac7bbd Remove obsolete tests from FixedPointDiagnostics (again) 2019-01-29 16:26:46 -08:00
David Smith
e7a007f231 InvalidStrideable.swift accidentally didn't catch the thing it was meant to test, and now just always crashes. This represents a small regression (possibly?) in diagnostic quality for an obscure edge case, but bringing that back can wait, we shouldn't leave the test crashing until then 2019-01-28 16:01:15 -08:00
Jordan Rose
a628d5d76a Mark another thorough String test as requiring an optimized stdlib (#21835)
This one's taking a pretty long time on simulators, only sometimes
making it under the timeout limit.
2019-01-15 15:37:31 -08:00
Pavel Yaskevich
e25d7b3c32 [TypeChecker] NFC: Workaround "expression too complex" in StringNormalization test
Resolves: rdar://problem/47149976
Resolves: rdar://problem/46830020
2019-01-11 11:46:16 -08:00
Michael Ilseman
509aa6bc14 [test] Require -O stdlib for long-running test 2019-01-08 17:41:42 -08:00
Lance Parker
15aaa1e777 [stdlib]String normalization functions (#21026)
* fast/foreignNormalize functions
2019-01-08 13:55:29 -08:00
David Smith
4e4325d248 Merge pull request #21235 from Catfish-Man/cheaper-by-the-dozen
Adopt bulk Dictionary creation in bridging
2018-12-21 11:37:40 -08:00
David Smith
016ced2c44 Adopt the new bulk Dictionary initializer in bridging 2018-12-20 16:57:38 -08:00
Maxim Moiseev
1f5c0f8bd4 Fix PersistentVector prototype 2018-12-18 16:12:48 -08:00
Karoy Lorentey
f0e04f73f4 [stdlib] Process elements from back to front 2018-12-18 09:49:58 -08:00
Karoy Lorentey
039891c24b [stdlib] Dictionary: Add support for non-unique keys in bulk loading init 2018-12-18 09:49:58 -08:00
Karoy Lorentey
f1f5e0f2bf [stdlib] Dictionary: Add unsafe bulk-loading initializer
Interface inspired by this Array pitch:
https://forums.swift.org/t/array-initializer-with-access-to-uninitialized-buffer/13689
2018-12-18 09:49:58 -08:00
Karoy Lorentey
c8664c490d [test] Dictionary: Add checks for expected failures in Dictionary bridging 2018-12-13 17:09:36 +00:00
Brent Royal-Gordon
eb81efe369 Update two diagnostics in validation tests 2018-12-12 13:01:38 -08:00
Michael Ilseman
647c60b6b1 Merge pull request #21217 from milseman/test_if_contiguous
[test] Test String.UTF8View.withContiguousStorageIfAvailable
2018-12-12 10:44:32 -08:00
John McCall
2ba7090fe8 Remove the extra-inhabitant value witness functions.
This is essentially a long-belated follow-up to Arnold's #12606.
The key observation here is that the enum-tag-single-payload witnesses
are strictly more powerful than the XI witnesses: you can simulate
the XI witnesses by using an extra case count that's <= the XI count.
Of course the result is less efficient than the XI witnesses, but
that's less important than overall code size, and we can work on
fast-paths for that.

The extra inhabitant count is stored in a 32-bit field (always present)
following the ValueWitnessFlags, which now occupy a fixed 32 bits.
This inflates non-XI VWTs on 32-bit targets by a word, but the net effect
on XI VWTs is to shrink them by two words, which is likely to be the
more important change.  Also, being able to access the XI count directly
should be a nice win.
2018-12-11 22:18:44 -05:00
Michael Ilseman
d6bee746ff [test] Test String.UTF8View.withContiguousStorageIfAvailable 2018-12-11 11:57:05 -08:00
Ben Cohen
11769d2494 Add tests for withContiguousStorageIfAvailable 2018-12-07 17:30:13 -08:00
Ben Cohen
ad50a39b12 [stdlib] Add withContiguous{Mutable}StorageIfAvailable (#21092)
* Add MutableCollection.withContiguousMutableStorageIfAvailable

* Add withContiguousMutableStorageIfAvailable impls

* Add tests on concrete types

* Add Sequence.withContiguousStorageIfAvailable

* Implement withContiguousStorageIfAvailable in concrete types
2018-12-07 10:01:18 -08:00
Karoy Lorentey
b77351548a Merge pull request #21045 from lorentey/modify-vs-throw
[stdlib] Dictionary: Support throwing yields in _modify accessors
2018-12-07 17:08:42 +00:00
Lance Parker
407a3fc34f Put the requires back in its place 2018-12-05 11:42:22 -08:00
Lance Parker
f051d6b9e4 added an opaque flavor of the normalization tests 2018-12-05 11:42:22 -08:00
Karoy Lorentey
ce96f1e528 [stdlib] _modify: Use defer to ensure invariants are restored when yield throws
_modify mustn’t leave Collection storage in an inconsistent state when the code to which we’re yielding happens to throw. In practice this means that any cleanup code must happen in defer blocks before the yield.

Fix Dictionary to do just that and add tests to cover this functionality (as well as some other aspects of _modify).
2018-12-05 17:35:24 +00:00
Ben Cohen
fc7830a4ed Remove Swift 3-only Compatibility Shims (#21019) 2018-12-04 18:22:27 -08:00
Lance Parker
da8ff3adee Merge pull request #20889 from lancep/NFC-codeunit-tests
Add tests for normalizing random unicode strings
2018-12-04 16:36:09 -08:00
Lance Parker
135476d594 These tests require unicode 11 2018-12-04 11:25:04 -08:00
Michael Ilseman
c0c530aef8 [String] Speed up constant factors on comparison.
Include some tuning and tweaking to reduce the constant factors
involved in string comparison. This yields considerable improvement on
our micro-benchmarks, and allows us to make less inlinable code and
have a smaller ABI surface area.

Adds more extensive testing of corner cases in our existing
fast-paths.
2018-12-03 15:49:38 -08:00
Michael Ilseman
94942c5b3b [String] Fix corner case in comparison fast-path. (#20937)
When in a post-binary-prefix-scan fast-path, we need to make sure we
are comparing a full-segment scalar, otherwise we miss situations
where a combining end-of-segment scalar would be reordered with a
prior combining scalar in the same segment under normalization in one
string but not the other.

This was hidden by the fact that many combining scalars are not
NFC_QC=maybe, but those which are not present in any precomposed form
have NFC_QC=yes. Added tests.
2018-12-03 10:41:45 -08:00
Karoy Lorentey
1ef6cf4813 Merge pull request #20866 from lorentey/deprecate-hashValue-1
[test] Modernize hashing throughout the test suite
2018-11-30 14:21:04 +00:00
Lance Parker
24e6a590b8 remove unecessary change to RUN: line 2018-11-29 15:32:17 -08:00
Lance Parker
dd700641d2 Add tests for normalizing random unicode strings 2018-11-29 14:53:01 -08:00
Karoy Lorentey
666a22feff [test] Modernize hashing throughout the test suite 2018-11-29 17:38:29 +00:00
Saleem Abdulrasool
c9cf8fcd20 Merge pull request #20719 from compnerd/threading-extras
port SwiftPrivatePthreadExtras to Windows
2018-11-29 08:45:57 -08:00
Doug Gregor
411c124248 Merge pull request #20776 from DougGregor/remangle-old-ext-generic-args
[Mangle] Include generic arguments of extensions for the Objective-C runtime
2018-11-26 20:18:36 -08:00
swift-ci
68884b286c Merge pull request #20768 from milseman/empty_range 2018-11-26 14:59:06 -08:00
Doug Gregor
cfc0f892e3 [Mangle] Include generic arguments of extensions for the Objective-C runtime
The remangler for the Objective-C runtime was dropping generic arguments
of extension contents, leading to collisions with @objc class names.
Include the generic arguments of extensions.

Fixes rdar://problem/45956357.
2018-11-26 13:51:40 -08:00
Saleem Abdulrasool
ce40d72641 stdlib: implement _stdlib_pthread_join in terms of Windows threading
Implement `_stdlib_pthread_join` in terms of windows threading.
Additionally, rename it to `_stdlib_thread_join`.
2018-11-26 13:10:00 -08:00
Saleem Abdulrasool
6bf7b9e711 stdlib: implement _stdlib_create_pthread_block in terms of Windows threaing
Port the block based thread constructor to Windows threading model, and
rename it to `_stdlib_create_thread_block`.
2018-11-26 13:10:00 -08:00
Saleem Abdulrasool
65bdce00b6 stdlib: rename _stdlib_PTHREAD_BARRIER_SERIAL_THREAD -> _stdlib_THREAD_BARRIER_SERIAL_THREAD 2018-11-26 13:10:00 -08:00
Saleem Abdulrasool
7b06586fe1 stdlib: rename _stdlib_pthread_barrier_t to _stdlib_thread_barrier_t 2018-11-26 13:09:49 -08:00