5.10: [Test] Restrict test to release stdlibs. #70146
Merged
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.
Description: Run OSLogMandatoryOptTest.swift only in configurations with release stdlibs.
#70068 introduced a simple but widespread change to SIL. It required updating a number of tests. The updates amounted to inserting numerous of
begin_borrow [var_decl]
instructions.On 5.10--but not main--OSLogMandatoryOptTest.swift had to be updated as well: several new
begin_borrow [var_decl]
instructions had to be FileCheck'd. These instructions all came from inlining code from the OSLogTestHelper target, a target which is built in the same configuration as the stdlib. In fact, they all came from inlining the_osLogTestHelper(_:assertion:)
function.When building OSLogTestHelper for release, no optimization passes are run on the function because it is marked
@_optimize(none)
.SemanticARCOpts
would have deleted these borrow scopes, but it doesn't run on the function.When building OSLogTestHelper for debug, however,
MandatoryARCOpts
(a subset ofSemanticARCOpts
) does run despite the function being marked@_optimize(none)
. That's because it's part of theOnonePassPipeline
which is mandatory, meaning that every pass runs on each function, regardless of it being annotated@_optimize(none)
.As a result the
begin_borrow [var_decl]
instructions--which FileCheck lines were added to match--are deleted before FileCheck runs. So the new check lines fail to match the deleted instructions. Besides the absence of these newbegin_borrow [var_decl]
instructions, there is no difference between the function in debug vs release. In particular, removing the newly added check lines allows the test to pass in a configuration with a debug stdlib.Rather than duplicate the test for debug configurations, just disable it in them.
On main, the new
begin_borrow [var_decl]
instructions were already deleted by a new mandatorybegin_borrow
simplification that exists only on main but not release/5.10, so they weren't present to be FileCheck'd in either configuration, which is why the test wasn't updated for main.Risk: None. Test-only change.
Scope: Zero. Affects a test.
Original PR: No.
Reviewed By: Andrew Trick ( @atrick )
Testing: Yes, this is a test change.
Resolves: rdar://118954955