-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[swift-3.0-preview-1] stdlib: test improvements #4009
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Issue better diagnostics, along with notes and fixits, for the common case of using an implicitly non-escaping parameter of function type in a context expecting an @escaping closure. Provides even more specific diagnostics for common scenarios such as passing to another function or assignment.
Extends the more useful diagnostics for non-escaping function parameters used in @escaping contexts to apply to all functions that are equivalent modulo ExtInfo.
Added sugared test case
3.0 noescape by default
This allows us to freely pass the address of a variable of such types to a C function without worrying about it overwriting other things if e.g. it memcpy's sizeof(T) bytes and thus clobbers the otherwise-non-existent tail padding. There are ways to get this optimization back, but they require things like materializing to a temporary instead of passing the address directly. We haven't done that work yet, so we don't get to take advantage of it. rdar://26828018
) Otherwise we get into a situation like this: 1. Change made to the interface of file A.swift that also causes an error in A.swift. 2. Fixing the error in A.swift does not affect A.swift's interface. 3. File B.swift that depends on A.swift is not rebuilt, since the most recent change to A.swift did not change its interface. To fix this, mark downstream files as needing to be rebuilt even when a compilation job fails with errors. Additionally, attempt to be extra conservative when there's a crash. rdar://problem/25405605 (cherry picked from commit 848b3eb)
Thanks, Dmitri. (cherry picked from commit b8cc267)
This ensures that blocks that come from `DispatchWorkItem`s will function correctly. The only exception is __dispatch_barrier_sync() as the block passed to that call is not `@convention(block)` so it doesn't matter. Fixes SR-2246.
[swift-3.0-branch] Added String.init<T>(_: T) and marked it unavailable
rdar://27226313 (cherry picked from commit b5a8805)
This test is known to fail on a debug stdlib
Huge thanks to John for noting that 'consume' didn't provide the guarantees we wanted, and to Michael G. for getting a TSan build up and running to identify/verify this race. It's possible that this is overlay strict, and that we only need to look at the domain to ensure that the code and userInfo are visible. However, TSan seems to prefix the form in this patch, so we'll be more conservative for now. Fixes rdar://problem/27541751. (cherry picked from commit e07e887)
Count tail-padding in the size of imported C types.
It is important to call doPreProcess to correctly setup the available opened archetypes which were referenced from the original instruction being copied. This fixes a concrete bug in LoopRotate optimization and potential bugs related to cloning. rdar://27659420
...because otherwise option sets that get imported as members using NS_SWIFT_NAME are printed with an 'enum' tag, and the definition of NS_OPTIONS only declares the typedef under C++. We should come back and figure out something more principled for this later, but for now this solves an issue with generated headers imported into C++ translation units. rdar://problem/27130343 (cherry picked from commit 02d2517)
…nitializer overlay
[sil-cloner] Always call doPreProcess when visiting SILInstructions.
…-race Eliminate a race condition in NSError bridging
[3.0] [Driver] Make sure to rebuild dependents when a dirty file fails.
[swift-3.0-branch] Fix Dispatch API's handling of block parameters
…asses. In addition to using the 'Class' existential representation for NSError, use it for subclasses of NSError, which can also be toll-free bridged. Narrowly addresses rdar://problem/27658748. (cherry picked from commit 3f960e3)
…xistentials. Imported Cocoa error types are represented by structs wrapping an NSError. The conversion from these structs to Error would end up boxing the structs in _SwiftNativeNSError, losing identity and leading to a wrapping loop. Instead, extract the embedded NSError if there is one. In the Swift runtime, do this as part of the dynamic cast to NSError, using a (new, defaulted) requirement in the Error type so we can avoid an extra runtime lookup of the protocol. In SILGEn, do this by looking for the _BridgedStoredNSError protocol conformance when erasing to an Error type. Fixes SR-1562 / rdar://problem/26370984. (cherry picked from commit d219531)
When emitting an existential erasure to Error from an archetype, use the _getEmbeddedNSError() witness. If it produces an NSError, erase that; otherwise, go through the normal erasure path. Of course, make NSError and CFError implement _getEmbeddedNSError() so this kicks in for the obvious cases as well as the more obscure ones. Fixes the rest of SR-1562 / rdar://problem/26370984. (cherry picked from commit 75e85dc)
…SError. This clarifies the 'Indirect' case. Thanks, Dmitri! (cherry picked from commit 4b8b7bb)
…r existential. SILGen already attempts to extract an embedded NSError when type-erasing to an Error existential; make the runtime do the same thing dynamically. Huge thanks to Joe Groff who noticed that I missed this path. (cherry picked from commit e83fb64)
rdar://problem/27678985
[swift-3.0-branch] SpriteKit overlay: add a better variant of the SKWarpGeometryGrid() initializer overlay
We're still seeing some problems on the CI from re-enabling this test, despite TSan being happy with the result. Disable this test again while we track the issue down.
[Swift 3.0] Eliminate double-wrapping of NSErrors in _SwiftNativeNSError
[Preset] SR-2232 Update preset to use build-swift-static-sdk-overlay
…ation [swift-3.0-branch] stdlib/Foundation: optimize the NSDictionary copy-constructor
These exact tests already exist in validation-test/stdlib/SpriteKit.swift.
Wrong target branch. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a cherry-pick of #3993, #3985, #3991, and (TODO) #4007.
Before merging this pull request to apple/swift repository:
Triggering Swift CI
The swift-ci is triggered by writing a comment on this PR addressed to the GitHub user @swift-ci. Different tests will run depending on the specific comment that you use. The currently available comments are:
Smoke Testing
A smoke test on macOS does the following:
device standard libraries are not built.
version of these tests are not run.
A smoke test on Linux does the following:
tests are not run.
Validation Testing
Lint Testing
Note: Only members of the Apple organization can trigger swift-ci.