Commit Graph

3245 Commits

Author SHA1 Message Date
Stephen Canon
dd0cddff9c Disable some SIMD Codable tests that are failing on i386. (#22116)
It looks like JSONEncoder can't round-trip floating-point values on i386 only. Likely an x87 excess-precision bug, but I don't have time to investigate right now. Tracked by https://bugs.swift.org/browse/SR-9759
2019-01-25 11:12:46 -05:00
Stephen Canon
3501568fc0 Make SIMD types Codable. (#22092)
* Make SIMD types codable. We're considering this a bugfix.

This is a very tiny ABI change, in that user-defined SIMD types compiled with an earlier version of 5.0 will be missing the necessary conformance to Codable. Discussed with Ben, and we're OK with this because we don't think there are such types yet, and it can be fixed with a recompile.

* Add basic tests
2019-01-24 23:08:29 -05:00
Karoy Lorentey
6af814d76c [test] Test new fix-it for NSObject.hashValue overrides 2019-01-23 19:44:01 -08:00
Scott Perry
df3a058a6f s/shortestEditScript/difference/g per proposal feedback 2019-01-21 22:31:04 -08:00
Maxim Moiseev
bceef544ec Better use of StdlibUnittest in compression tests 2019-01-17 15:07:20 -08:00
Eric Bainville
556f79d8d0 InputFilter, OutputFilter overlay for the Darwin Compression stream API, and corresponding test 2019-01-16 14:41:06 -08:00
Ben Cohen
eb083ce84d Revert "implement ManagerBuffer.reallocated to allow realloc'ing the storage" (#21874)
* Revert "implement ManagerBuffer.reallocated to allow realloc'ing the storage"
2019-01-16 10:22:58 -08:00
Mike Ash
577e04d35b Merge pull request #21331 from mikeash/rename-avoid-objc-conflicts
[Stdlib][Overlays] Rename various classes to avoid conflicting ObjC names.
2019-01-15 17:50:05 -05:00
Mike Ash
fa5888fb3f [Stdlib][Overlays] Rename various classes to avoid conflicting ObjC names.
Old Swift and new Swift runtimes and overlays need to coexist in the same process. This means there must not be any classes which have the same ObjC runtime name in old and new, because the ObjC runtime doesn't like name collisions.

When possible without breaking source compatibility, classes were renamed in Swift, which results in a different ObjC name.

Public classes were renamed only on the ObjC side using the @_objcRuntimeName attribute.

This is similar to the work done in pull request #19295. That only renamed @objc classes. This renames all of the others, since even pure Swift classes still get an ObjC name.

rdar://problem/46646438
2019-01-15 12:21:20 -05:00
Saleem Abdulrasool
7ca074bd07 test: port most of the stdlib tests to Windows
This adjusts the standard library test suite to mostly pass on Windows.
The remaining failures are due to various cases:

- memory corruption (`_swift_stdlib_free` in swiftDemangle)
- heap corruption (canGrowUsingRealloc)
- withVAList failure (unresolved)
- unicode handling on the command line
2019-01-15 09:19:06 -08:00
Scott Perry
c0c068d663 Match indentation style 2019-01-14 15:53:24 -08:00
Max Moiseev
3b6c6cc0a5 Merge pull request #19532 from dlbuckley/SR-8649_ranges_codable
SR-8649: Range types conform to Codable
2019-01-14 14:38:32 -08:00
Scott Perry
7c13fe3fa7 Adapt the last of the Darwin- and XCTest-specific code in the diffing tests 2019-01-14 11:07:17 -08:00
Scott Perry
1af14db552 Initial import of diffing package into standard library 2019-01-13 20:17:20 -08:00
Itai Ferber
446e89ca9e Typo fixes in tests 2019-01-11 14:40:01 -08:00
Itai Ferber
28993690fd Clarify new append tests 2019-01-11 11:17:43 -08:00
Itai Ferber
076effdf5d Correct buffering in .init<S> and .append<S> and add unit test 2019-01-11 10:14:27 -08:00
Itai Ferber
af626bf03c Remove Data.hashValue==NSData.hashValue test 2019-01-10 10:29:09 -08:00
Brent Royal-Gordon
ea8e2a20fc Merge pull request #21452 from brentdax/to-error-is-human-to-forgive-domain
Change error domains on @objc enums to ensure they're unique
2019-01-03 15:48:25 -08:00
Michael Ilseman
851b46fa55 [test] Restore test and remove old portion 2019-01-02 15:11:42 -08:00
Brent Royal-Gordon
1875783734 Use more robust Swift type names for error domains
getErrorDomainStringForObjC() now includes the parent types in the error domain string. Its implementation does not support generic types or private discriminators, but those types can’t be PrintAsObjC’d anyway, so we should never see them.
2018-12-21 15:45:23 -08:00
Brent Royal-Gordon
2eed5374db Only generate domains for PrintAsObjC-able types
Otherwise we generate a call to String(reflecting:), which correctly handles many things we may not be able to (like private types), and which matches the default implementation of Error._domain.
2018-12-21 15:45:21 -08:00
Doug Gregor
34113d1f86 Merge pull request #21339 from DougGregor/simd-custom-string-convertible
[SIMD] Add CustomDebugStringConvertible conformance for SIMD types.
2018-12-14 20:43:36 -08:00
Doug Gregor
fbf4bb738d [SIMD] Add CustomDebugStringConvertible conformance for SIMD types.
The old SIMD types had a conformance to CustomDebugStringConvertible,
but the new ones do not, causing a source compatibility
regression. Add back a CustomDebugStringConvertible conformance.

Fixes rdar://problem/46746829.
2018-12-14 17:00:17 -08:00
Itai Ferber
d8d6c7812c Add #available checks for NSKeyedArchiver methods in tests 2018-12-13 12:55:57 -08:00
Itai Ferber
d4e42c0dd1 Merge pull request #20225 from phausler/inline_data_and_dataprotocol
DataProtocol and new inline Data
2018-12-12 16:10:13 -08:00
swift-ci
bb443c6ed5 Merge pull request #21233 from brentdax/thats-this-diagnostic-sorted 2018-12-12 14:59:02 -08:00
Max Moiseev
83ccb23c97 Merge pull request #20958 from jshier/add-result
SE-0235: Add Result<Success, Failure: Error> to Standard Library
2018-12-12 14:00:15 -08:00
Brent Royal-Gordon
a72be0fb7d Sort overloads in suggestPotentialOverloads()
When the compiler fails to find an overload with suitable parameter or return types, it often attaches a note listing the available overloads so that users can find the one they meant to use. The overloads are currently ordered in a way that depends on the order they were declared, so swift-evolve would sometimes cause tests involving these diagnostics to fail.

This change emits the list in a textually-sorted order instead. The names were already being sorted as they were inserted into a std::set, so this shouldn’t significantly slow down the diagnostic.
2018-12-12 11:58:57 -08:00
Saleem Abdulrasool
0cdc6149d3 Merge pull request #21210 from compnerd/ill-replace-you-with-a-tiny-python-script
stdlib: replace shell script with python
2018-12-11 20:02:58 -08:00
Saleem Abdulrasool
6618ec17dd stdlib: replace shell script with python
Replace timeout.sh with timeout.py.  This makes it portable to other
platforms like Windows.
2018-12-11 17:28:39 -08:00
Philippe Hausler
d030354320 Initial draft of DataProtocol ContiguousCollection and new inline Data 2018-12-11 11:19:36 -08:00
Saleem Abdulrasool
37032d8995 test: guard Float80 on Windows
Windows does not support fp80 even on x86.  Adjust the test conditions
accordingly.
2018-12-11 08:45:59 -08:00
Doug Gregor
281e3c490c [Test] Re-enabled stdlib/ErrorBridgedStatic.
This test appears to have been fixed by
https://github.com/apple/swift/pull/21107. Fixes rdar://problem/42789939.
2018-12-09 20:51:26 -08:00
Jon Shier
85df179b84 Add additional test cases and use checkEquatable. 2018-12-09 19:08:32 -05:00
Slava Pestov
929bf610e0 Runtime: Fix demangling of function with single tuple-typed argument
While declaration mangling now does the right thing for parameter lists,
the function type mangling unfortunately still models the parameter list
as a single tuple node.

Change the runtime's behavior to match the AST mangler, which wraps
a single tuple-typed parameter in a tuple node, so that we can produce
different mangling trees for function types taking multiple arguments
versus a single tuple argument.
2018-12-08 23:57:21 -05:00
Pitiphong Phongpattranont
61238eda54 Uses the expectCrash instead of xfail in the Encoder Tests 2018-12-08 16:47:56 +07:00
Pitiphong Phongpattranont
02df51496d NIT fixing and add some comments in the test methods 2018-12-08 13:39:40 +07:00
Pitiphong Phongpattranont
8097d342da Added: Expected to failed test cases on requesting an already requested mismatched container type 2018-12-08 13:39:40 +07:00
Pitiphong Phongpattranont
a0272f921b Write the test cases of the Encoding Multiple NestedContainers with The Same Top Level Key case
Fixed test
2018-12-08 13:39:37 +07:00
Ben Cohen
11769d2494 Add tests for withContiguousStorageIfAvailable 2018-12-07 17:30:13 -08:00
Bob Wilson
d24bb36aab Merge pull request #21119 from mikeash/existential-metatype-metadata-cast-fix
[Runtime] Fix incorrect cast in NonFixedExistentialMetatypeBox::Container::getNumWitnessTables.
2018-12-07 15:20:07 -08:00
Greg Parker
368ca184fa [runtime] Fix some bugs when the stable ABI's is-Swift bit is set. (#21114)
* cmake: Propagate SWIFT_DARWIN_ENABLE_STABLE_ABI_BIT to overlay builds.
* runtime: Clear the correct bit in getROData()
* test/IRGen/objc_class_export.swift: Allow either is-Swift bit.
* test/stdlib/SwiftObjectNSObject.swift: Allow either name for SwiftObject.
2018-12-07 12:47:39 -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
Mike Ash
2114ce011e [Runtime] Fix incorrect cast in NonFixedExistentialMetatypeBox::Container::getNumWitnessTables.
The incorrect cast led to absurd values for getNumWitnessTables which then caused crashes (or worse?) down the line.

SR-8158 rdar://problem/41725205
2018-12-07 09:51:12 -05:00
Saleem Abdulrasool
6e7051eb1e Merge pull request #20944 from compnerd/os-family
stdlib: restructure for OS family layout of SDK overlay
2018-12-06 18:22:51 -08:00
Max Moiseev
80ae4de685 Update test/stdlib/Result.swift
Co-Authored-By: jshier <jon@jonshier.com>
2018-12-06 17:54:17 -05:00
Max Moiseev
1834f0a87e Update test/stdlib/Result.swift
Co-Authored-By: jshier <jon@jonshier.com>
2018-12-06 17:54:10 -05:00
swift-ci
80abe8ca2f Merge pull request #21044 from mikeash/anyhashable-to-enum-fix 2018-12-06 12:31:45 -08:00
Saleem Abdulrasool
41d9c2cc59 stdlib: restructure for OS family layout of SDK overlay
The SDK directory is now confusing as the Windows target also has a SDK
overlay.  In order to make this more uniform, move the SDK directory to
Darwin which covers the fact that this covers the XNU family of OSes.
The Windows directory contains the SDK overlay for the Windows target.
2018-12-06 11:32:05 -08:00