Add more DataFlow tests from linker to NativeAOT (#72777)
authorVitek Karas <10670590+vitek-karas@users.noreply.github.com>
Mon, 1 Aug 2022 08:26:50 +0000 (01:26 -0700)
committerGitHub <noreply@github.com>
Mon, 1 Aug 2022 08:26:50 +0000 (01:26 -0700)
commit05c6f3d13fbab9344e7482b5445fa4d57645defe
tree7f43287aba97d10f6355a36e40a9f12885e932f5
parent01444f73dcc85e04bfc808cd9f34d823c8eedb0a
Add more DataFlow tests from linker to NativeAOT (#72777)

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)
- Improve origin of warnings generated from attributes
35 files changed:
src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/Dataflow/DiagnosticUtilities.cs
src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/Dataflow/FlowAnnotations.cs
src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/Dataflow/MethodBodyScanner.cs
src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/CustomAttributeBasedDependencyAlgorithm.cs
src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/MetadataManager.cs
src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/UsageBasedMetadataManager.cs
src/coreclr/tools/aot/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptPrivateImplementationDetails.cs [new file with mode: 0644]
src/coreclr/tools/aot/Mono.Linker.Tests.Cases/DataFlow/ApplyTypeAnnotations.cs [new file with mode: 0644]
src/coreclr/tools/aot/Mono.Linker.Tests.Cases/DataFlow/ArrayDataFlow.cs [new file with mode: 0644]
src/coreclr/tools/aot/Mono.Linker.Tests.Cases/DataFlow/AssemblyQualifiedNameDataflow.cs
src/coreclr/tools/aot/Mono.Linker.Tests.Cases/DataFlow/AttributeConstructorDataflow.cs [new file with mode: 0644]
src/coreclr/tools/aot/Mono.Linker.Tests.Cases/DataFlow/AttributeFieldDataflow.cs [new file with mode: 0644]
src/coreclr/tools/aot/Mono.Linker.Tests.Cases/DataFlow/AttributePropertyDataflow.cs [new file with mode: 0644]
src/coreclr/tools/aot/Mono.Linker.Tests.Cases/DataFlow/ByRefDataflow.cs [new file with mode: 0644]
src/coreclr/tools/aot/Mono.Linker.Tests.Cases/DataFlow/CompilerGeneratedCodeDataflow.cs [new file with mode: 0644]
src/coreclr/tools/aot/Mono.Linker.Tests.Cases/DataFlow/CompilerGeneratedTypes.cs [new file with mode: 0644]
src/coreclr/tools/aot/Mono.Linker.Tests.Cases/DataFlow/ComplexTypeHandling.cs [new file with mode: 0644]
src/coreclr/tools/aot/Mono.Linker.Tests.Cases/DataFlow/Dependencies/MemberTypesAllBaseTypeAssembly.cs [new file with mode: 0644]
src/coreclr/tools/aot/Mono.Linker.Tests.Cases/DataFlow/Dependencies/TestSystemTypeBase.cs [new file with mode: 0644]
src/coreclr/tools/aot/Mono.Linker.Tests.Cases/DataFlow/Dependencies/UnresolvedLibrary.cs [new file with mode: 0644]
src/coreclr/tools/aot/Mono.Linker.Tests.Cases/DataFlow/DynamicDependencyDataflow.cs [new file with mode: 0644]
src/coreclr/tools/aot/Mono.Linker.Tests.Cases/DataFlow/EventDataFlow.cs [new file with mode: 0644]
src/coreclr/tools/aot/Mono.Linker.Tests.Cases/DataFlow/ExceptionalDataFlow.cs [new file with mode: 0644]
src/coreclr/tools/aot/Mono.Linker.Tests.Cases/DataFlow/FieldDataFlow.cs [new file with mode: 0644]
src/coreclr/tools/aot/Mono.Linker.Tests.Cases/DataFlow/IReflectDataflow.cs [new file with mode: 0644]
src/coreclr/tools/aot/Mono.Linker.Tests.Cases/DataFlow/LocalDataFlowKeptMembers.cs [new file with mode: 0644]
src/coreclr/tools/aot/Mono.Linker.Tests.Cases/DataFlow/MemberTypesAllOnCopyAssembly.cs [new file with mode: 0644]
src/coreclr/tools/aot/Mono.Linker.Tests.Cases/DataFlow/MethodByRefParameterDataFlow.cs [new file with mode: 0644]
src/coreclr/tools/aot/Mono.Linker.Tests.Cases/DataFlow/MethodByRefReturnDataFlow.cs [new file with mode: 0644]
src/coreclr/tools/aot/Mono.Linker.Tests.Cases/DataFlow/MethodParametersDataFlow.cs [new file with mode: 0644]
src/coreclr/tools/aot/Mono.Linker.Tests.Cases/DataFlow/MethodReturnParameterDataFlow.cs [new file with mode: 0644]
src/coreclr/tools/aot/Mono.Linker.Tests.Cases/DataFlow/MethodThisDataFlow.cs [new file with mode: 0644]
src/coreclr/tools/aot/Mono.Linker.Tests.Cases/DataFlow/TypeBaseTypeDataFlow.cs [new file with mode: 0644]
src/coreclr/tools/aot/Mono.Linker.Tests.Cases/DataFlow/UnresolvedMembers.cs [new file with mode: 0644]
src/coreclr/tools/aot/Mono.Linker.Tests/TestCasesRunner/ResultChecker.cs