Skip to content

Commit

Permalink
Add compiler-generated code tests for NativeAot (#77457)
Browse files Browse the repository at this point in the history
This adds the compiler-generated code tests from illink and enables them for NativeAot.

Includes fixes in the test infrastructure required to make some of the tests pass.
  • Loading branch information
sbomer authored Nov 28, 2022
1 parent 0eebd73 commit ebb461a
Show file tree
Hide file tree
Showing 6 changed files with 2,327 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<DefineConstants>$(DefineConstants);INCLUDE_EXPECTATIONS</DefineConstants>
<WarningLevel>0</WarningLevel>
<AnalysisLevel>0</AnalysisLevel>
<RunAnalyzers>true</RunAnalyzers>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,9 @@ class GenericWithStaticMethod<T>
public static void GenericTypeWithStaticMethodWhichRequires () { }
}

// NativeAOT doesnt produce Requires warnings in Generics https://github.com/dotnet/runtime/issues/68688
// [ExpectedWarning("IL2026", "--GenericTypeWithStaticMethodWhichRequires--"]
[ExpectedWarning ("IL2026", "--GenericTypeWithStaticMethodWhichRequires--", ProducedBy = ProducedBy.Analyzer | ProducedBy.Trimmer)]
// [ExpectedWarning("IL3002", "--GenericTypeWithStaticMethodWhichRequires--", ProducedBy = ProducedBy.Analyzer | ProducedBy.NativeAot)]
// NativeAot is missing ldftn detection: https://github.com/dotnet/runtime/issues/68786
[ExpectedWarning ("IL2026", "--GenericTypeWithStaticMethodWhichRequires--", ProducedBy = ProducedBy.Trimmer | ProducedBy.Analyzer)]
[ExpectedWarning ("IL3002", "--GenericTypeWithStaticMethodWhichRequires--", ProducedBy = ProducedBy.Analyzer)]
// [ExpectedWarning("IL3050", "--GenericTypeWithStaticMethodWhichRequires--", ProducedBy = ProducedBy.Analyzer | ProducedBy.NativeAot)]
[ExpectedWarning ("IL3050", "--GenericTypeWithStaticMethodWhichRequires--", ProducedBy = ProducedBy.Analyzer)]
public static void GenericTypeWithStaticMethodViaLdftn ()
{
Expand Down
Loading

0 comments on commit ebb461a

Please sign in to comment.