Skip to content

Commit

Permalink
Enable compiler-generated code tests for NativeAot (dotnet/linker#3085)
Browse files Browse the repository at this point in the history
Update compiler-generated code tests for sharing with NativeAot.

Commit migrated from dotnet/linker@dfe94f2
  • Loading branch information
sbomer authored Nov 28, 2022
1 parent 3e97742 commit 3490c51
Show file tree
Hide file tree
Showing 4 changed files with 259 additions and 116 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ public Task RequiresInCompilerGeneratedCode ()
return RunTest (nameof (RequiresInCompilerGeneratedCode));
}

[Fact]
public Task RequiresInCompilerGeneratedCodeRelease ()
{
return RunTest ();
}

[Fact]
public Task RequiresOnAttribute ()
{
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 3490c51

Please sign in to comment.