Commit Graph

3245 Commits

Author SHA1 Message Date
Bob Wilson
2e12ac8d74 Merge pull request #24836 from bob-wilson/rdar50173830
[Test] Conditionalize KVOKeyPaths tests that only work with Swift 5.1
2019-05-21 09:38:24 -07:00
David Smith
7561f95134 Test foreign strings on invalid content more thoroughly 2019-05-17 16:18:34 -07:00
Bob Wilson
1e3317be78 [Test] Conditionalize KVOKeyPaths tests that only work with Swift 5.1
Some of the tests in KVOKeyPaths.swift check problems that were not fixed
until Swift 5.1 so they are not expected to pass when running with the
5.0 libraries.

rdar://problem/50173830
2019-05-16 12:57:25 -07:00
swift-ci
aa6827a46d Merge pull request #24796 from ravikandhadai/oslog-optimization 2019-05-15 13:01:37 -07:00
swift-ci
d1cc7136dd Merge pull request #23793 from phausler/data_mapped_perf_bug 2019-05-15 07:58:32 -07:00
Brent Royal-Gordon
dce879f508 Revert "[Foundation] Fix availability of NSValue.value(of:)" 2019-05-15 05:17:42 -07:00
Ravi Kandhadai
9be4fef53a [SIL Optimization] Add a mandatory optimization pass for optimizing
the new os log APIs based on string interpolation.
2019-05-14 18:08:59 -07:00
Philippe Hausler
8a751bd4de Add tests and validate Data and DispatchData as sequences 2019-05-14 17:12:44 -07:00
Bob Wilson
6160545800 Merge pull request #24498 from lorentey/nsvalue-availability
[Foundation] Fix availability of NSValue.value(of:)
2019-05-14 15:22:22 -07:00
Bob Wilson
1d98709131 [Test] Add runtime 9999-availability check for a new test in Swift 5.1
The testEncodingMultipleNestedContainersWithTheSameTopLevelKey check is new
in Swift 5.1 and will not pass when running with a 5.0 stdlib.

rdar://problem/50151131
2019-05-14 12:27:27 -07:00
Sho Ikeda
6eead16283 [gardening] Remove unnecessary breaks 2019-05-15 00:54:33 +09:00
Mike Ash
5c6a93ef2b [Test] Delete ErrorBridgedStatic test.
This test checks that error bridging with ObjC bridging works when the stdlib is statically linked. We no longer support static linking of the stdlib on platforms with ObjC interop.

rdar://problem/49699316
2019-05-10 12:07:24 -04:00
Mike Ash
893e291739 [Runtime] Add a test for +class and +self overrides.
rdar://problem/49853091
2019-05-09 13:11:05 -04:00
Daniel Rodríguez Troitiño
3658b6c786 Merge pull request #24550 from drodriguez/android-enable-some-more-tests
[android] Enable some tests that should pass on Android.
2019-05-07 11:01:13 -07:00
Karoy Lorentey
ae5884e7d3 [test] TestNotification: Check availability before running hashing test
The Foundation overlay had a different hash encoding for TestNotification.
2019-05-06 18:45:02 -07:00
Daniel Rodríguez Troitiño
1813cc3670 [android] Enable some tests that should pass on Android.
Some tests are limited to only Linux, when they should also pass for
Android.

Additionally, InputStream.swift.gyb was disabled for Android ARMv7, but
wasn't for Android AArch64, which allow me to find the error on it and
fix it on #24521.

Finally, StringLowercasedUppercased is interesting in Android because it
checks the used ICU is correct for performing the tasks that the stdlib
needs.
2019-05-06 17:53:51 -07:00
Brent Royal-Gordon
7311886219 Merge pull request #24334 from brentdax/wherefore-art-thou-api
[TypeChecker] Rephrase platforms in availability diagnostics
2019-05-06 11:00:03 -07: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
fbe5563d60 [Foundation] Fix availability of NSValue.value(of:) 2019-05-03 19:55:03 -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
Karoy Lorentey
3c33145210 [test] Add availability guard on Character behavior test 2019-05-03 19:09:47 -07:00
Karoy Lorentey
7f1c139b28 [test] Add availability guards on Foundation hashing tests 2019-05-03 19:09:47 -07:00
David Smith
1192b914d2 Merge pull request #24457 from Catfish-Man/two-by-two-length-of-blue
Fix bounds check in bridged ASCII String comparison
2019-05-03 18:28:55 -07:00
David Smith
008699e52d Fix bounds check in bridged ASCII String comparison 2019-05-03 15:55:58 -07:00
Steve (Numerics) Canon
d4b90f4837 Temporarily disable all the Accelerate tests.
These are testing for bitwise identical results, but don't guarantee that
the buffers being used always have identical alignment. This will result
in small rounding differences when vector codepaths are used for different
elements of some results.

This is partially an underlying bug in Accelerate (which is outside the
scope of this project to fix), and partly a test bug (which we can address
by adopting approximate comparisons here). In the short term, though, I'm
going to disable these.
2019-05-03 09:12:30 -04:00
simon gladman
e96f61c8bc Use elementsAlmostEqual to resolve suspected alignment-induced failures
`DoublePrecisionInterpolateBetweenNeighbours ` was occasionally faliing on tvOS simulator. Not using exact equality appears to have fixed this issue. The code I've used for `isAlmostEqual` is based on SE-0259
2019-05-02 11:27:43 +01:00
simon gladman
b93479c455 Fix arrayFromBuffer
A buffer's `data` may contain padding when the `rowBytes` isn't equal to the number of chanels * width * size of the element. I've updated arrayFromBuffer to return an array that excludes any `rowByte` padding.
2019-05-01 13:47:55 +01:00
Mishal Shah
7f5162864e Disable ErrorBridgedStatic.swift to unblock toolchain bot.
rdar://50279940
2019-04-30 23:51:26 -07:00
Brent Royal-Gordon
3494c0bd88 [TypeChecker] Rephrase platforms in availability diagnostics
This does several different things to improve how platforms are described in availability diagnostics:

• Mentions the platform in diagnostics for platform-specific @available(unavailable) attributes.
• Replaces “OS X” with “macOS”.
• Replaces “fooOS application extension” with “application extensions for fooOS”.
• Replaces “on fooOS” with “in fooOS”.

Fixes <rdar://problem/49963341>.
2019-04-30 16:32:43 -07:00
simon gladman
96e181c53e update test image size 2019-04-30 18:13:43 +01:00
simon gladman
a55641a1b2 [vImage] Don't Infer Pixel Size in Buffer Copy
A buffer's `rowBytes` doesn't have a direct relationship with its `height`, so `rowBytes / Int(width)` isn't a good way to calculate pixel size. To resolve this, I've added `pixelSize` as a parameter to `vImage_Buffer.copy`.
2019-04-30 17:50:10 +01:00
Stephen Canon
d2f695935f Add availability information to the new Math function protocols (#24187)
* Add availability information to the new Math function protocols

The protocols ElementaryFunctions, RealFunctions, and Real are new in Swift 5.1 and accordingly need to have availability attached to them for platforms that are ABI-stable. The actual implementation hooks (static functions) are unconditionally defined on scalar types and marked @_alwaysEmitIntoClient, so they are available even when targeting older library versions, but the protocols themselves, and anything defined in terms of them (the global functions and the SIMD extensions) is only available when targeting library versions that have the new protocols.

* Additionally provide concrete implementations of signGamma for each stdlib-builtin floating-point type.

* Remove Real[Functions] protocols pending re-review

Temporarily pull these back so we can make minor tweaks to the design and get a re-review on SE.
2019-04-29 17:39:33 -04:00
Karoy Lorentey
d9c166fdb9 Merge pull request #23832 from lorentey/foundation-hashing
[Foundation] Modernize hashing in Foundation's Swift-only types
2019-04-26 14:59:13 -07:00
Steve (Numerics) Canon
4dc72c7df9 XFAIL the vImage test, as it's falling over for arm64. 2019-04-26 11:59:04 -04:00
Steve (Numerics) Canon
4c7027c038 Temporarily disable a new vImage test that's failing for some platforms. 2019-04-25 14:01:46 -04:00
simon gladman
5936a04510 [Accelerate] [vImage] Swift Overlays (#23592)
* Accelerate vImage Swift Overlays

A suite of functions, enumerations, and option sets to make working with vImage in Swift simpler.

* vImage_Buffer - new initializers to instantiate and initialize buffers with a single function call.
* vImage_Buffer - new functions to copy buffers and create CGImage instances from contents.
* vImage_CGImageFormat - new initializers.
* vImage_CGImageFormat - new equivalence operator.
* vImageConverter - methods to wrap free functions.
* vImageConverter - new make and convert functions.
* vImageCVImageFormat - new make functions.
* vImageCVImageFormat - methods to wrap free functions.
* vImage_Error - errorDescription function.
* vImage flags as an option set.

* Add new methods for generating CV -> CG and CG -> CV converters.

* update comments: `height` and `width` to `size`.

* `vImage_CGImageFormat.componentCount` should be `Int`.

* `vImage_CGImageFormat.componentCount` should be `Int`

* Move `self.init()` to after the size check for kvImageNoAllocate init.

* Buffer initializers to width and height rather than size.

* change vImage_CGImageFormat lightweight initializer to accept Int for `bitsPerComponent` and `bitsPerPixel`.

* Flesh out docs for vImage_Buffer.size

* Remove faux initializer in favor of new static function: `preferredAlignmentAndRowBytes`.

* Change functions to use proper error handling rather than inout error codes.

* Removed `flags` from basic init.

The only real flag to pass here is print diagnostics to console, and I now throw proper errors.

* Tests to check error throwing for buffer copy.

* remove unnecessary import, add missing docs.

* Add comments to error enums.

* Fix bug creating string from format code.

* Make `vImageCVImageFormat.formatCode` a `UInt32`.

* Remove equivalence operator from `CGImageFormat`.
2019-04-25 08:40:45 -04:00
Karoy Lorentey
530687f564 [test] TestPersonNameComponents: adjust OS check for hashing 2019-04-25 00:34:55 -07:00
Karoy Lorentey
6647c50d41 [test] TestNotification: Fix checkHashable invocation 2019-04-23 23:07:00 -07:00
Stephen Canon
a0676e02ab [Accelerate] [vDSP] DFT, FFT, DCT, and Biquad (#24207)
* Swift overlay to vDSP cascaded biquad IIR filter.

* update comment in test

* Swift overlay to vDSP Discrete Cosine Transform

* Swift Overlays to vDSP Fast Fourier Transform and Discrete Fourier Transform

* Tests for DFT and FFT

* Some refactoring and begin documentation.

* Swift overlays to FFT and DFT operations.

* Expand docs.
* Implement `vDSP_destroy_fftsetup` and `vDSP_destroy_fftsetupD`

* Refactor Tests

* Refactor Tests

* Provide transform function that returns the result. Refactoring: parameter names more consistent with other vDSP operations, push `fileprivate` symbols to bottom of file.

* Add apply() function that returns the result.

* Added a version of DFT transform that returns the result.

* update some DFT comments

* Remove FFT overlays from this branch to separate DFT and FFT pull requests.

* [Accelerate] [vDSP] Swift Overlays to FFT Operations

This PR contains Swift overlays to simplify performing 1D and 2D fast Fourier transforms on single- and double-precision data.

This PR includes a subset of the operations (e.g. vDSP_fft_zrop for FFT). My plan is to add the additional operations (e.g. multiple signals, in-place operations, etc.) in a subsequent PR once this is approved.

cc: @moiseev @airspeedswift @stephentyrone

* Composite Branch

Contains FFT, DFT, DCT, and Biquad branches.
2019-04-23 12:31:18 -04:00
Simon Gladman
3c813faa01 Composite Branch of vDSP Swift Overlay Work
Contains the following:

	[Accelerate] [vDSP] Swift Overlays to Sliding Window Summation Operations
	[Accelerate] [vDSP] Swift Overlays to Linear Interpolation Operations
	[Accelerate] [vDSP] Swift Overlays to Complex Vector Operations
	[Accelerate] [vDSP] Swift overlays to 1D and 2D convolution operations.
	[Accelerate] [vDSP] Swift overlays to dot product and distance functions.
	[Accelerate] [vDSP] Swift overlays to `vDSP_desamp` and `vDSP_deq22`.
	[Accelerate] [vDSP] Vector Reduction Functions
	[Accelerate] [vDSP] Elementwise Vector-Vector and Vector-Scalar Arithmetic
	[Accelerate] [vDSP] Miscellaneous Conversion Functions
	[Accelerate] [vDSP] Polynomial Evaluation Functions
	[Accelerate] [vDSP] Clipping, Limit, and Threshold Functions
	[Accelerate] [vDSP] Fill, Clear, and Generation Functions
	[Accelerate] [vDSP] Integration Functions
	[Accelerate] [vDSP] Vector Type Conversion Functions
	[Accelerate] [vDSP] Swift overlays to Vector-Vector Extrema and Single-Vector Operations
2019-04-20 10:59:03 +01:00
Simon Gladman
7be3ed7d96 Merge remote-tracking branch 'origin/accelerate-vDSP-singleVectorOperations' into Accelerate_Swift-vDSP-Overlays 2019-04-20 10:03:32 +01:00
Simon Gladman
48abf32851 Merge branch 'accelerate-vDSP-conversion' into Accelerate_Swift-vDSP-Overlays 2019-04-20 10:02:01 +01:00
Simon Gladman
ac4b5b9e92 Merge remote-tracking branch 'origin/accelerate-vDSP-integration' into Accelerate_Swift-vDSP-Overlays 2019-04-20 09:50:55 +01:00
Simon Gladman
8b76ff5124 Merge branch 'accelerate-vDSP-fillClearGenerate' into Accelerate_Swift-vDSP-Overlays 2019-04-20 09:49:59 +01:00
Simon Gladman
8571214ae3 Merge remote-tracking branch 'origin/accelerate-vDSP-clippingLimitThreshold' into Accelerate_Swift-vDSP-Overlays 2019-04-20 09:48:44 +01:00
Simon Gladman
2ee19145df Merge remote-tracking branch 'origin/accelerate-vDSP-polynomialEvaluation' into Accelerate_Swift-vDSP-Overlays 2019-04-20 09:47:31 +01:00
Simon Gladman
87ab1d614b Merge remote-tracking branch 'origin/accelerate-vDSP-miscConversions' into Accelerate_Swift-vDSP-Overlays 2019-04-20 09:46:02 +01:00
Simon Gladman
eabf7d46ac Merge remote-tracking branch 'origin/accelerate-vDSP-elementwiseVectorArithmetic' into Accelerate_Swift-vDSP-Overlays 2019-04-20 09:44:55 +01:00
Simon Gladman
a2ad79fc9e Merge remote-tracking branch 'origin/accelerate-vDSP-vectorReduction' into Accelerate_Swift-vDSP-Overlays 2019-04-20 09:43:29 +01:00
Simon Gladman
95eaa0d3ad Merge remote-tracking branch 'origin/accelerate-vDSP-differenceEquationAndDownsampling' into Accelerate_Swift-vDSP-Overlays 2019-04-20 09:41:42 +01:00