Commit Graph

153 Commits

Author SHA1 Message Date
Michael Spencer
b2640e15e4 [test] Rename all module.map files to module.modulemap
`module.map` as a module map name has been discouraged since 2014, and
Clang will soon warn on its usage. This patch renames all instances of
`module.map` in the Swift tests to `module.modulemap` in preparation
for this change to Clang.

rdar://106123303
2023-08-21 15:58:59 -07:00
Karoy Lorentey
b82ce9c3be [stdlib] Adopt _pointerBitWidth conditional 2023-04-27 13:33:24 -07:00
nate-chandler
5e0267b9b7 Merge pull request #64553 from nate-chandler/eagermove_collections
[stdlib] Collection types are eagerMove.
2023-03-30 16:16:26 -07:00
Nate Chandler
cda365ca8d [stdlib] Collection types are eagerMove.
Types that have "value semantics" should not have lexical lifetimes.
Value types are not expected to have custom deinits. Are not expected to
expose unsafe interior pointers. And cannot have weak references because
they are structs. Therefore, deinitialization barriers are irrelevant.

rdar://107076869
2023-03-30 11:04:47 -07:00
Alejandro Alonso
f16f0c3c23 Update the stdlib to use Unicode 15 data 2023-03-29 10:18:16 -07:00
Alsey Coleman Miller
62b7be4e9c [stdlib] Add RISCV64 support 2022-11-01 23:59:42 -07:00
David Smith
27a27fe034 Fix test 2022-08-09 14:35:10 -07:00
David Smith
ad00633cf1 Fix assert 2022-08-09 14:12:20 -07:00
David Smith
f966017c9c Review feedback 2022-08-08 17:27:23 -07:00
David Smith
b3d8875834 Iterate on the long tagged string test 2022-08-08 16:23:54 -07:00
David Smith
e0dd80fe3b Handle long tagged NSStrings 2022-08-05 19:02:37 -07:00
Anthony Latsis
087eba83a2 Merge pull request #59757 from AnthonyLatsis/close-issues-2
Add regression tests to close several issues p. 2
2022-06-29 02:48:54 +03:00
Anthony Latsis
7732306fa9 Add regression test to close #43135 2022-06-25 00:48:02 +03:00
Alejandro Alonso
95da55b182 [stdlib] Implement String.WordView (#42414)
* Implement String.WordView

* Add isWordAligned bit

* Hide WordView for now (also separate Index type)

add bidirectional conformance

Fix tests

* Address comments from Karoy and Michael

* Remove word view, use index methods

* Address Karoy's comments

aaa
2022-06-22 09:10:09 -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
Alejandro Alonso
657c17fa39 Setup grapheme breaking tests 2022-02-15 17:16:36 -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
Alejandro Alonso
014e822cb2 Address Michael's comments
fix infinite recursion bug

NFC: Remove early ccc check

remember that false is turned on
2021-09-29 14:20:22 -07:00
Erik Eckstein
6f4192927e tests: refactor Array test files.
* move all ObjC array tests into a separate file ArraysObjc.swift.gyb
* merge the remaining Arrays.swift.gyb and ArrayNew.swift.gyb files
* move the utilities from ArrayTypesAndHelpers.swift into its only use into ArraysObjc.swift.gyb
2021-06-17 11:30:59 +02:00
Robert Widmann
0149ccd0ca Add arm64_32 support for Swift
Commit the platform definition and build script work necessary to
cross-compile for arm64_32.

arm64_32 is a variant of AARCH64 that supports an ILP32 architecture.
2021-04-20 14:59:04 -07:00
Ben Rimmington
d2495f87f0 [stdlib] Reinstate the FixedPointConversion tests (#36205)
* [stdlib] Reinstate the FixedPointConversion tests

* [stdlib] Update the FixedPointConversion tests

* [stdlib] Generate the FixedPointConversion tests

* [stdlib] FixedPointConversion_Release32: long_test
2021-03-09 22:24:03 -05:00
Michael Gottesman
8f1b353568 [mandatory-combine] Just like SILCombine, perform SIL canonicialization while performing mandatory combining. 2020-12-04 16:47:40 -08:00
Max Desiatov
0c8b86601c test: Replace _silgen_name w/ _cdecl in CommandLineStressTest
This test abuses @_silgen_name unnecessarily according to https://forums.swift.org/t/how-can-my-c-main-function-call-swift/40244/2
2020-09-14 09:23:22 +01:00
Stephen Canon
103961a7d5 Make Float16 unavailable on macOS and macCatalyst, mirroring Xcode's Swift. (#32868)
LLVM doesn't have a stable ABI for Float16 on x86 yet; we're working with Intel to get that fixed, but we don't want to make the type available on macOS until a stable ABI is actually available, because we'd break binaries compiled before any calling convention changes if we do.
2020-07-14 20:42:12 -04:00
Karoy Lorentey
da242bd2d4 [SDK] Remove obsolete overlay code 2020-06-22 15:43:39 -07:00
Mishal Shah
272c466e47 Update master to build with Xcode 12 beta 2020-06-22 15:43:20 -07:00
Stephen Canon
248c554524 Add Float16 to stdlib (#30130)
Add Float16 (IEEE 754 binary16) to the standard library, plus assorted runtime support operations.

Swift Evolution thread: https://forums.swift.org/t/se-0277-float16/33546
2020-04-06 17:57:44 -04:00
Erik Eckstein
66852e2bb7 tests: fix Array test
The Array/removeNonUnique test is not working with an old runtime.

rdar://problem/58471030
2020-01-10 09:50:34 +01:00
Erik Eckstein
88a9ebb9f8 stdlib: Don't request additional capacity in Array/ContiguousArray's remove.
Just copy the buffer if it's not unique.
This also implies that if there is a copy-on-write in remove, "shrink" the capacity of the new buffer to the required amount of elements (instead of copying the capacity of the original buffer).
2020-01-09 16:17:38 +01:00
Mike Ash
7d4bf753f4 [Test] Don't test demangling of SwiftObject's name, as it's subject to change.
rdar://problem/57163094
2019-11-15 12:56:24 -05:00
Arnold Schwaighofer
7a54927b03 IRGen: Fix MemoryLayout::offset(of:) for tail allocated C arrays
There is no storage but an offset.

rdar://51194713
2019-10-15 14:04:31 -07:00
David Smith
1cce12f20c Add an Array-based NSMutableArray subclass 2019-09-24 18:15:33 -07:00
David Smith
92eaeca0b2 Fix test to ignore two unused classes still present on old runtimes 2019-08-27 13:52:25 -07:00
David Smith
0887299d9e Fix sub-scalar index distances in foreign UTF8 views 2019-08-02 16:45:42 -07:00
David Smith
e7b1107212 Merge pull request #26374 from Catfish-Man/unindex-set
Remove unused Foundation subclasses
2019-07-26 17:09:45 -07:00
David Smith
48266a6f56 Remove unused Foundation subclasses 2019-07-26 14:47:43 -07:00
David Smith
d091ecb009 Restore more-correct behavior of getting the full contents of bridged NSStrings containing invalid UTF-8 2019-07-16 12:05:56 -07:00
Stephen Canon
dc5915cdb5 Replace stdlib and test/stdlib 9999 availability. (#26108)
* Replace stdlib and test/stdlib 9999 availability.

macOS 9999 -> macOS 10.15
iOS 9999 -> iOS 13
tvOS 9999 -> tvOS 13
watchOS 9999 -> watchOS 6

* Restore the pre-10.15 version of public init?(_: NSRange, in: __shared String)

We need this to allow master to work on 10.14 systems (in particular, to allow PR testing to work correctly without disabling back-deployment tests).
2019-07-12 16:30:36 -04:00
Mike Ash
7696a76577 [Runtime] Add a test case for a race with dlopen and libobjc.
rdar://problem/49742015
2019-06-14 15:06:40 -04:00
Saleem Abdulrasool
1c41c0887c validation-test: adjust stdlib tests for Windows
The embedded shell script in the RUN command for lit is problematic for
non-sh shell environments (i.e. Windows).  This adjusts the tests to
uniformly build the code for the ObjC runtime.  However, the Objective-C
code is only built under the same circumstances that it is currently
enabled - the availability of the needed frameworks.  The empty object
on other runtimes will have no material impact.  The swift side of it
checks whether the runtime is built with ObjC interop.  This allows us
to largely use the same command line for all the targets.  The last
missing piece is that the `-fobjc-runtime` requires that we run a modern
ObjC runtime.  We enable this unconditionally in lit for the non-Apple
targets.

This improves the validation test coverage for the standard library on
Windows.
2019-06-03 08:36:22 -07:00
David Smith
7561f95134 Test foreign strings on invalid content more thoroughly 2019-05-17 16:18:34 -07:00
Mike Ash
893e291739 [Runtime] Add a test for +class and +self overrides.
rdar://problem/49853091
2019-05-09 13:11:05 -04:00
Karoy Lorentey
d6a6315e76 Merge pull request #24496 from lorentey/stdlib-version-checks-alt
[test] Add availability guards for tests checking behavioral changes in 5.1
2019-05-06 10:24:32 -07:00
Karoy Lorentey
211aae1574 [test] Array: Add availability guard to crash test
Array.init(unsafeUninitializedCapacity:…) back-deploys to the 5.0 stdlib, but the implementation there doesn’t catch buffer reassignment.
2019-05-03 19:09:47 -07:00
David Smith
008699e52d Fix bounds check in bridged ASCII String comparison 2019-05-03 15:55:58 -07:00
Nate Cook
b6bb9d2f8c [stdlib] Make unsafe array initializer public (#23134)
[stdlib] Make unsafe array initializer public

This implements SE-0245. The public versions of this initializer call
into the existing, underscored version, which avoids the need for
availability constraints.
2019-03-23 13:18:10 -05:00
Arnold Schwaighofer
a67f3b919d Merge pull request #23452 from aschwaighofer/add_test_optimize_none_implicit_dynamic
Add a test mode to exercise implicit dynamic
2019-03-22 06:24:14 -07:00
Daniel Rodríguez Troitiño
4dcf60ca0f [test] Fix FixedPointConversion tests (#23220)
Fix several problems with FixedPointConversion generation code.

The first problem is that at some point `repr(value)` was being used,
which turn the number into a string. That was great for printing the
number, but make the test against the value of the number (like
`testValue < otherMin` always false. There were a number of tests that
were never performed, specifically the integer tests.

The second problem was using doubles in the Python code. For Float32 and
Float64 the tests were generated correctly, but in the case of Float80,
the test adding or removing a quantity to the maximum/minimum were
failing because of the lack of precission (Adding 0.1 to a very
big/small number is the same as not adding anything). Switching to
Decimal should keep enough precission for the tests.

Finally the last problem was that the bounds of the conversions are not
actually `selfMin` and `selfMax`, but the values returned by the utility
function `getFtoIBounds`. For example for unsigned types, the lower
bound is always -1, not zero (every value between -1 and zero is rounded
to zero, and doesn't fail).

Instead of using nested gyb templates, use lit.cfg %target-ptrsize,
which should be faster, cleaner, and provides correct line-directive
output.

Remove a bunch of warnings in Swift when compiling the generated result
of FixedPointConversion.swift.gyb.

Co-authored-by: Gwynne Raskind <gwynne@users.noreply.github.com>
2019-03-21 13:58:30 -04:00