Commit Graph

3245 Commits

Author SHA1 Message Date
swift-ci
1ee42620c7 Merge remote-tracking branch 'origin/main' into rebranch 2022-06-09 11:53:31 -07:00
Butta
3933fc0006 [android][test] Fix several tests on the Android CI
- #58975 switched many tests from XFAIL on linux to linux-gnu, so seven
  fail on the Android CI and two natively. They are now explicitly excluded.
- #39605 added several C++ Interop tests, 11 of which fail on the Android CI,
  so disable them for now.
- #42478 removed the @noescape attribute for the non-Android
  SIL/clang-function-types tests, so I remove it for Android too.
- My pull #40779 moved the Swift pointer tags to the second byte, so
  SILOptimizer/concat_string_literals.64 will need to be updated for that,
  disabled it for now.
- Compiler-rt moved the directory in which it places those libraries for
  Android, llvm/llvm-project@a68ccba, so lit.cfg is updated for that.
2022-06-09 14:35:41 +05:30
Ben Barham
bcffb8e543 [next] Temporarily disable tgmath.swift.gyb
Disable `test/stdlib/tgmath.swift.gyb` while it's being looked into in
order to unblock CI.
2022-06-08 15:19:32 -07:00
Allan Shortlidge
e365fd1ef4 Tests: Mark test/stdlib/StringCreate.swift as unsupported on back deployment bots.
Using XFAIL won't work here because the tests pass on the iOS back deployment bots, resulting in a UPASS.

I was able to take a look at the test binary and rule out both codegen for `if #available(...)` and the optimizer as culprits so the next step is to check if `_stdlib_isOSVersionAtLeast()` is actually busted in the runtime libraries in older versions of macOS.
2022-06-06 17:05:18 -07:00
Allan Shortlidge
c0b91c9cad Tests: XFAIL test/stdlib/StringCreate.swift on the back deployment bots until the failures there can be investigated further. 2022-06-02 09:14:23 -07:00
Ben Barham
c163e0fe5e [Tests] Make OS features consistent
lit.py currently allows any substring of `target_triple` to be used as a
feature in REQUIRES/UNSUPPORTED/XFAIL. This results in various forms of
the OS spread across the tests and is also somewhat confusing since they
aren't actually listed in the available features.

Modify all OS-related features to use the `OS=` version that Swift adds
instead. We can later remove `config.target_triple` so that these don't
the non-OS versions don't work in the first place.
2022-05-20 19:51:23 -07:00
Karoy Lorentey
07ffddebae Merge pull request #58954 from lorentey/string-bincompat-workarounds
[stdlib] Work around binary compatibility issues with String index validation fixes in 5.7
2022-05-18 11:09:44 -07:00
Karoy Lorentey
50c2399a94 [stdlib] Work around binary compatibility issues with String index validation fixes in 5.7
Swift 5.7 added stronger index validation for `String`, so some illegal cases that previously triggered inconsistently diagnosed out of bounds accesses now result in reliable runtime errors. Similarly, attempts at applying an index originally vended by a UTF-8 string on a UTF-16 string now result in a reliable runtime error.

As is usually the case, new traps to the stdlib exposes code that contains previously undiagnosed / unreliably diagnosed coding issues.

Allow invalid code in binaries built with earlier versions of the stdlib to continue running with the 5.7 library by disabling some of the new traps based on the version of Swift the binary was built with.

In the case of an index encoding mismatch, allow transcoding of string storage regardless of the direction of the mismatch. (Previously we only allowed transcoding a UTF-8 string to UTF-16.)

rdar://93379333
2022-05-17 19:25:10 -07:00
David Smith
9dd8d3ad1a Actually slice things in _StringGutsSlice 2022-05-17 14:31:11 -07:00
Josh Soref
624a54b9cf Spelling stdlib (#42544)
* spelling: abcdefghijklmnopqrstuvwxyz

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: clazz

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: collection

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: compressible

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: constituent

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: contiguous

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: convertibility

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: element

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: enforce

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: exhaustive

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: exhausts

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: existential

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: facilitate

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: ignored

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: incorporated

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: intersection

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: laziness

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: misaligned

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: overhaul

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: preamble

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: precondition

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: replacement

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: trailing

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: unambiguous

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: uncompressible

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: world

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
2022-04-22 19:18:38 -07:00
Doug Gregor
c76a99ba02 [SE-0352] Enable implicit opening of existentials by default 2022-04-20 17:51:04 -07:00
Karoy Lorentey
2574d78d40 Merge pull request #42442 from lorentey/better-index-conversions 2022-04-19 20:22:06 -07:00
Karoy Lorentey
e21b846828 [test] Add new tests for String.Index(_:within:) 2022-04-18 20:57:54 -07:00
swift-ci
58c8e2ecd8 Merge pull request #41033 from glessard/se-unaligned
[SE-0349] Implementation for unaligned loads from raw memory
2022-04-18 15:29:52 -07:00
Guillaume Lessard
3971f28228 [test] make back-deployment testing possible 2022-04-18 16:27:08 -06:00
Guillaume Lessard
2e54373236 [test] Test new unaligned store behaviour 2022-04-18 10:44:06 -06:00
Karoy Lorentey
318277c3aa [test] stdlib/StringIndex: Spin off O(n^4) substring replacement test into a standalone long test
Also trim down its input a bit so that this doesn’t take 20 minutes.
2022-04-15 21:29:32 -07:00
Guillaume Lessard
18622f518c [test] new stdlib load/store behaviours 2022-04-15 16:31:49 -06:00
Guillaume Lessard
f42705b536 [gardening] remove unnecessary warnings from test 2022-04-15 13:39:22 -06:00
Karoy Lorentey
66a8ae07dc [test] Move string test helper methods to StdlibUnittest
This fixes a Windows regression triggered by
https://github.com/apple/swift/pull/41417.
2022-04-14 21:36:45 -07:00
Karoy Lorentey
57f0e67658 Merge pull request #41417 from lorentey/the-horror-of-se-0180
[stdlib] Fix String indexing edge cases, anomalies & validation bugs
2022-04-14 14:08:53 -07:00
Karoy Lorentey
cb2194c024 [stdlib] Fix ABI and portability issues 2022-04-13 19:15:30 -07:00
Daniel Duan
3dfc40898c [NFC] Remove Python 2 imports from __future__ (#42086)
The `__future__` we relied on is now,  where the 3 specific things are
all included [since Python 3.0](https://docs.python.org/3/library/__future__.html):

* absolute_import
* print_function
* unicode_literals
* division

These import statements are no-ops and are no longer necessary.
2022-04-13 14:01:30 -07:00
swift-ci
a7edd6065c Merge pull request #42287 from glessard/rdar90336023
[test] check for availability before testing
2022-04-10 16:45:50 -07:00
Guillaume Lessard
f4533d4a53 [test] check for availability before testing
- These tests verify updated behaviour of existing API, and should check for availability first.
2022-04-10 14:01:32 -06:00
Guillaume Lessard
622eb497a5 Merge pull request #42232 from glessard/rdar90336023
[test] expectCrashLater(withMessage:) reliability workaround
2022-04-07 14:43:06 -06:00
Guillaume Lessard
8e3a47682b [test] just don’t check for the crash message 2022-04-07 10:44:31 -06:00
Karoy Lorentey
71216009e3 [test] Move useful helpers into StdlibUnicodeUnittest 2022-04-06 20:11:05 -07:00
Guillaume Lessard
152353157c [stdlib] less assumingMemoryBound, rebind instead 2022-04-06 16:18:02 -06:00
Guillaume Lessard
8032a7c0c9 [test] work around a linux testing issue 2022-04-06 04:18:17 -06:00
Karoy Lorentey
42c823847e [test] stdlib/StringIndex: Simplify 2022-04-05 20:47:42 -07:00
Guillaume Lessard
b13377726f [stdlib] improve the new deprecation messages 2022-04-05 14:43:03 -06:00
Guillaume Lessard
cfdb44ee7e [test] check deprecation warnings for undesirable overloads 2022-04-04 20:26:40 -06:00
Guillaume Lessard
a76b6ae8d0 [test] add tests of String-from-C-string inout conversion overloads 2022-04-04 17:53:54 -06:00
Guillaume Lessard
a8e2463cc2 [test] add tests of String-from-C-string String overloads 2022-04-04 17:53:20 -06:00
Guillaume Lessard
32fc00ee0b [test] add tests of String-from-C-string Array overloads 2022-04-04 17:44:37 -06:00
Karoy Lorentey
1c9c5ccbf6 [test] test/StringIndex: Add some tests exercising replaceSubrange
The exhaustive substring.replaceSubrange test probably takes too long
to include in regular testing, but let’s enable it for now: it has
caught a bunch of problems already and it will probably catch more
before this lands.
2022-03-29 20:00:08 -07:00
Karoy Lorentey
06090ce7f2 [test] Add more String coverage 2022-03-29 20:00:08 -07:00
Karoy Lorentey
99f693e4ba [test] stdlib/StringIndex: Review & extend with more cases 2022-03-24 21:00:00 -07:00
Karoy Lorentey
683b9fa021 [stdlib] Adjust/fix String’s indexing operations to deal with the consequences of SE-0180 2022-03-24 20:59:59 -07:00
Alejandro Alonso
27e6241a41 Merge pull request #41389 from Azoy/fix-indic-sequences
[stdlib] Fix backwards count of Indic graphemes
2022-03-14 12:08:21 -07:00
Alsey Coleman Miller
0ab3eec987 Added PowerPC 32-bit support 2022-03-03 22:21:33 -05:00
Karoy Lorentey
33bb68c2f2 [test] stdlib/StringTraps: Add some coverage for foreign traps in UTF-8/16 views
These trigger Objective-C exceptions in Foundation, but the fact these operations reliably trap when applied to foreign strings is part of the String contract in the stdlib, and we should have regression tests for them.
2022-03-01 19:22:16 -08:00
Karoy Lorentey
1da581642c Merge pull request #41599 from lorentey/string-unicodescalarview-index-validation
[stdlib] String.UnicodeScalarView: Fix some index validation issues
2022-03-01 16:27:34 -08:00
Karoy Lorentey
20c293ee18 Merge pull request #41598 from lorentey/string-index-validation
[stdlib] String.index(before:): Fix index validation issues
2022-03-01 16:27:03 -08:00
Guillaume Lessard
577015f5be Merge pull request #39639 from glessard/se-pointer-convenience
SE-0334: Pointer API Usability Improvements
2022-03-01 13:24:25 -07:00
Karoy Lorentey
2757088edc [test] stdlib/StringTraps: Add some test coverage for String.UnicodeScalarView 2022-03-01 10:05:05 -08:00
Karoy Lorentey
f528db51c5 [test] stdlib/StringTraps: Add some test coverage for String.index(before:) traps 2022-02-28 18:20:52 -08:00
Guillaume Lessard
e83ccd33c0 [test] fix test of withMemoryRebound
- The test did not properly test the intent of the change from 82fa4b0ea8
2022-02-28 17:40:14 -07:00
Guillaume Lessard
dd4b646651 [test] test SE-0334 additions 2022-02-25 13:35:20 -07:00