forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 333
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
[lldb] Make module-ownership.mm test more robust against AST node ord… #1197
Merged
Teemperor
merged 2 commits into
swiftlang:apple/stable/20200108
from
Teemperor:cherry/710fa2c4ee346e1ec2db66ac5fdf6909e79d9a8c
May 11, 2020
Merged
[lldb] Make module-ownership.mm test more robust against AST node ord… #1197
Teemperor
merged 2 commits into
swiftlang:apple/stable/20200108
from
Teemperor:cherry/710fa2c4ee346e1ec2db66ac5fdf6909e79d9a8c
May 11, 2020
Conversation
This file contains 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
…ering The current test is checking both the anonymous structs and the template specializations in one FileCheck run, but the anonymous struct line can partially match the AST dump of a template specialization, causing that FileCheck won't match that same line later against the template specialization check and incorrectly fails on that check. This only happens when the template specialization node somehow ends up before the anonymous struct node. This patch just puts the checks for the anonymous structs in their own FileCheck run to prevent them from partially matching any other record decl. Fixes rdar://62997926 (cherry picked from commit 710fa2c)
@swift-ci test |
…test running again The relevant output FileCheck is scanning in this test is as follows: CXXRecordDecl 0x7f96cf8239c8 <<invalid sloc>> <invalid sloc> imported in A.B <undeserialized declarations> struct definition <<DefinitionData boilerplate>> `-FieldDecl 0x7f96cf823b90 <<invalid sloc>> <invalid sloc> imported in A.B anon_field_b 'int' (anonymous struct) CXXRecordDecl 0x7f96cf823be8 <<invalid sloc>> <invalid sloc> imported in A.B struct Before 710fa2c this test was passing by accident as it had a -DAG suffix in the checks changed by this patch, causing FileCheck to first match the last line of the output above (instead of the first one), and then finding the FieldDecl above. When I removed the -DAG suffix, FileCheck actually enforced the ordering and started failing as the FieldDecl comes before the CXXRecordDecl match we get. This patch fixes the CXXRecordDecl check to find the first line of the output above which caused FileCheck to also find the FieldDecl that follows. Also gives the FieldDecl a more unique name to make name collisions less likely. (cherry picked from commit 7283ec0)
@swift-ci test I also cherry-picked a fix for the test that make it pass upstream, but weirdly this test passes on the stable branch even without as our Downstream output:
Upstream output:
|
adrian-prantl
approved these changes
May 8, 2020
@swift-ci test |
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.
…ering
The current test is checking both the anonymous structs and the template
specializations in one FileCheck run, but the anonymous struct line can
partially match the AST dump of a template specialization, causing that
FileCheck won't match that same line later against the template specialization
check and incorrectly fails on that check. This only happens when the
template specialization node somehow ends up before the anonymous struct node.
This patch just puts the checks for the anonymous structs in their own FileCheck
run to prevent them from partially matching any other record decl.
Fixes rdar://62997926
(cherry picked from commit 710fa2c)