[5.0] Test that newer libobjcs let the Swift runtime set up a class's layout #21970
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.
Explanation: When a Swift class is referenced from Objective-C first, new versions of the Objective-C runtime will give the Swift runtime a chance to lay out that class properly. This is important for resilience, since up until now Objective-C isn't used to the size of a class changing based on anything other than a superclass's size changing.
This commit is just a test; the actual implementation went in months ago, but didn't have a libobjc we could test against at the time.
Scope: Most interesting behavior is only tested on unreleased Apple OSs, but it's still testing class layout on released OSs.
Issue: rdar://problem/45718008
Risk: None. Test change only.
Testing: Tested on both old and new 64-bit macOS systems, old and new 64-bit iOS simulators, an old 32-bit iOS simulator, and a new 32-bit watchOS simulator.
Reviewed by: @slavapestov, @mikeash