Skip to content

5.10: [Test] Restrict test to release stdlibs. #70146

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

Merged
merged 1 commit into from
Dec 1, 2023

Conversation

nate-chandler
Copy link
Contributor

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 of SemanticARCOpts) does run despite the function being marked @_optimize(none). That's because it's part of the OnonePassPipeline 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 new begin_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 mandatory begin_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

**Description**: Run OSLogMandatoryOptTest.swift only in configurations with release stdlibs.

swiftlang#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 of `SemanticARCOpts`) _does_ run despite the function being marked `@_optimize(none)`.  That's because it's part of the `OnonePassPipeline` 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 new `begin_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 mandatory `begin_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
Copy link
Contributor

@atrick atrick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@nate-chandler
Copy link
Contributor Author

@swift-ci please test

@nate-chandler nate-chandler marked this pull request as ready for review December 1, 2023 01:13
@nate-chandler nate-chandler requested a review from a team as a code owner December 1, 2023 01:13
@nate-chandler nate-chandler merged commit 5d6d7e2 into swiftlang:release/5.10 Dec 1, 2023
@nate-chandler nate-chandler deleted the rdar118954955 branch December 1, 2023 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants