Skip to content
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

Add more DataFlow tests from linker to NativeAOT #72777

Merged
merged 7 commits into from
Aug 1, 2022

Conversation

vitek-karas
Copy link
Member

This adds several dataflow tests from linker - only those which are passing with the fixes in this change. More will be added later.

Fixes:

  • Correctly handle Requires attributes in generic types
  • Recognize ref Type as interesting for data flow
  • Fix generic parameter propagation for compiler generated types
  • Treat multi-dimensional arrays as "Unknown" values (to match linker behavior)

This adds several dataflow tests from linker - only those which are passing with the fixes in this change. More will be added later.

Fixes:
- Correctly handle Requires attributes in generic types
- Recognize `ref Type` as interesting for data flow
- Fix generic parameter propagation for compiler generated types
- Treat multi-dimensional arrays as "Unknown" values (to match linker behavior)
@vitek-karas
Copy link
Member Author

The changes to the tests are ported back to linker in dotnet/linker#2912.

Copy link
Contributor

@tlakollo tlakollo left a comment

Choose a reason for hiding this comment

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

Are we sure about having all these tests whose main focus is to verify if things are kept? I think once we start to validate the kept attribute now we will have to do it 100% right or we will break CI

…his changes MetadataManager interface, but it should not be a problem.

This fixes the attribute test failures.

The CompilerGeneratedCodeDataflow test was failing because AOT didn't scan the body of the MoveNext method in the state machine for iterators. This is because the test actually never references IEnumerator<>.MoveNext and so the interface method and all of its implementations are removed. Fixed by making an explicit reference to it at least once.
@vitek-karas
Copy link
Member Author

Please see c1ca4bc for fixes to all CI failures.

This was missed during porting of the changes from linker.

More cleanup of tests.
Copy link
Member

@MichalStrehovsky MichalStrehovsky left a comment

Choose a reason for hiding this comment

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

Thank you!

@vitek-karas vitek-karas merged commit 05c6f3d into dotnet:main Aug 1, 2022
@vitek-karas vitek-karas deleted the AotTests2 branch August 1, 2022 08:26
@ghost ghost locked as resolved and limited conversation to collaborators Aug 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants