Commit Graph

26 Commits

Author SHA1 Message Date
Karoy Lorentey
5274295e3f [test] Update tests for new (conditional) _debugPrecondition behavior 2022-02-18 21:54:02 -08:00
Alejandro Alonso
98feb5e6ec Add availability to a few new tests (#40048)
its available, not availabile
2021-11-05 16:01:19 -07:00
Karoy Lorentey
e2cfab4f28 [stdlib][test] Adopt availability macros in tests 2021-10-31 15:00:58 -07:00
Erik Eckstein
bec687db1b ConstantFolding: remove a wrong peephole optimization for signed "< 0" and ">= 0" comparisons
The wrong optimization was: fold x < 0 into false, if x is known to be a result of an unsigned operation with overflow checks enabled.
It was done under the wrong assumption that the result of an overflow-checked unsigned operation fits into a signed integer and is positive.
This is wrong, because the result of an unsigned operation can be larger than Int.max and therefore, when used in a signed integer operation, be re-interpreted as a negative signed value.

Fixes a miscompile which resulted in a missing abort on arithmetic overflow.

rdar://73596890
2021-10-27 14:20:19 +02:00
Max Desiatov
04b47d7bdc test: mark a few tests as unsupported on Wasm/WASI (#39504)
Certain traps can't be supported on WASI, such as expectations for crashes, `setjmp` use, dynamic linking, multi-threading etc. These tests are marked as `UNSUPPORTED` when targeting Wasm/WASI.
2021-09-29 16:25:38 +01:00
Mishal Shah
23c3b15f5f Support Xcode 13 beta
* Updating availability versions
* Remove all remaining overlays in stdlib/public/Darwin/*:
   - ObjectiveC
   - Dispatch
   - CoreFoundation
   - CoreGraphics
   - Foundation
2021-06-07 12:04:31 -07:00
Karoy Lorentey
4b2f032fac [test] Disable tests for newly introduced Range behavior on earlier OSes 2021-01-06 13:03:58 -08:00
Karoy Lorentey
c5c27c7c69 [stdlib] Add a missing debug precondition to [Closed]Range.init(uncheckedBounds:)
Unchecked APIs must still perform checks in debug builds to ensure that invariants aren’t violated.
(I.e., these aren’t a license to perform invalid operations — they just let us get rid of the checks when we know for sure they are unnecessary.)
2020-12-04 02:06:22 -08:00
Stephen Canon
457b9990e9 Add checks that the endpoints of partial ranges are not-NaN. (#33378)
We can't actually check for NaN (because the notion doesn't exist for Comparable), but we can require that the endpoint is non-exceptional by checking if it equals itself.
2020-08-10 14:06:46 -04:00
Arnold Schwaighofer
2d8a1dbbfe Codesign test/stdlib 2018-08-10 06:58:40 -07:00
Slava Pestov
3f872ecabc These tests now pass in resilient builds 2017-10-27 19:00:47 -07:00
Lance Parker
acf94f94ec Add -Onone to all the _Debug tests 2017-09-18 12:56:52 -07:00
Dmitri Gribenko
984210aa53 tests: replace '// RUN: rm -rf' '// RUN: mkdir' pairs with '%empty-directory(...)'
These changes were made using a script.
2017-06-04 11:08:39 -07:00
swift-ci
2dce594005 Merge pull request #9143 from apple/revert-9139-revert_8710 2017-04-30 18:49:17 -07:00
swift-ci
8790997723 Merge pull request #9140 from airspeedswift/xfail-resilient-range 2017-04-30 17:37:17 -07:00
Ben Cohen
38903764df Revert "Revert "[stdlib] One-sided ranges and RangeExpression (#8710)"" 2017-04-30 16:47:23 -07:00
ben-cohen
a7cf116e8f XFAIL RangeTraps.CountablePartialRangeFrom in resilient mode 2017-04-30 16:11:35 -07:00
Arnold Schwaighofer
7d5d63eaf8 Revert "[stdlib] One-sided ranges and RangeExpression (#8710)"
This reverts commit 946b776e37.
2017-04-30 15:51:16 -07:00
Ben Cohen
946b776e37 [stdlib] One-sided ranges and RangeExpression (#8710)
* One-sided ranges and RangeExpression

* Remove redundant ClosedRange methods from String

* Fix up brittle tests

* Account for Substring update

* XFAIL range diagnostics on Linux
2017-04-28 12:59:04 -07:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
practicalswift
797b80765f [gardening] Use the correct base URL (https://swift.org) in references to the Swift website
Remove all references to the old non-TLS enabled base URL (http://swift.org)
2016-11-20 17:36:03 +01:00
Max Moiseev
9fc37efee4 [test] renaming test/1_stdlib to just test/stdlib 2016-09-01 16:51:43 -07:00
Jordan Rose
e83c117c30 [test] Hack: run stdlib tests first to start long-running tests earlier.
This decreases total testing time by over a minute on my old Mac Pro.
It probably has much less effect on systems with fewer cores, but shouldn't
be any worse there.

Swift SVN r22745
2014-10-15 01:30:51 +00:00
Greg Parker
b09a3a3963 [test] Disable enforcement of a buggy Range<Int> bounds check in 32-bit.
Swift SVN r19965
2014-07-14 23:21:31 +00:00
Dave Abrahams
8b41540d8d [stdlib] Fix a typo Dmitri found
Thanks, Dmitri!

Swift SVN r19904
2014-07-13 20:54:52 +00:00
Dave Abrahams
be37cd904b [stdlib] Trap invalid Ranges of Comparable Indexes
When the Index type of a Range is Comparable, we can reject invalid
ranges at their formation.

It might be worth injecting some checkability concept into ForwardIndex
so that even in generic contexts where Comparability is unknown, we can
do this same check in the Range constructor.

Also, remove pattern matching support for Ranges of RandomAccessIndex,
as that is covered by Interval.

Fixes <rdar://problem/16254937> (#Seed 4: Ranges with negative strides
are broken) to the extent possible (it's still possible to form an
invalid Range of indices that are not Comparable)

Fixes <rdar://problem/17164391> (Swift: Using ranges in for in for
counting down, causes the loop to go inifinely)

Fixes <rdar://problem/17580871> (Swift: Closed range with negative
endpoint excludes that endpoint)

Swift SVN r19903
2014-07-13 19:58:21 +00:00