Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Remove ref local test, add issue links
  • Loading branch information
sbomer authored and github-actions committed Aug 22, 2023
commit 7b2ff7d59a9778ea0e76b4d10fb8621ef1fc6315
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ public static void Main ()

PointerDereference.Test ();
MultipleOutRefsToField.Test ();
SingleRefCapture.Test ();
MultipleRefCaptures.Test ();
}

Expand Down Expand Up @@ -190,28 +189,6 @@ public static void Test ()
}
}

[Kept]
class SingleRefCapture
{
[Kept]
[ExpectedWarning ("IL2062", nameof (DataFlowTypeExtensions.RequiresAll), ProducedBy = Tool.Trimmer | Tool.NativeAot)]
[ExpectedWarning ("IL2072", nameof (GetUnknownType), nameof (DataFlowTypeExtensions.RequiresAll), ProducedBy = Tool.Analyzer)]
[ExpectedWarning ("IL2072", nameof (GetTypeWithPublicFields), nameof (DataFlowTypeExtensions.RequiresAll), ProducedBy = Tool.Analyzer)]
static void TestArrayElementReferenceAssignment ()
{
var arr1 = new Type[] { GetUnknownType () };
ref var local = ref arr1[0];
local = GetTypeWithPublicFields ();
arr1[0].RequiresAll ();
}

[Kept]
public static void Test ()
{
TestArrayElementReferenceAssignment ();
}
}

[Kept]
class MultipleRefCaptures
{
Expand Down Expand Up @@ -269,6 +246,7 @@ static void TestLocalAssignment (bool b = true)
[ExpectedWarning ("IL2072", nameof (GetTypeWithPublicConstructors), nameof (DataFlowTypeExtensions.RequiresAll), ProducedBy = Tool.Analyzer)]
[ExpectedWarning ("IL2072", nameof (GetTypeWithPublicFields), nameof (DataFlowTypeExtensions.RequiresAll), ProducedBy = Tool.Analyzer)]
[ExpectedWarning ("IL2072", nameof (GetTypeWithPublicFields), nameof (DataFlowTypeExtensions.RequiresAll), ProducedBy = Tool.Analyzer)]
// ILLink/ILCompiler produce different warning code: https://github.com/dotnet/linker/issues/2737
[ExpectedWarning ("IL2062", nameof (DataFlowTypeExtensions.RequiresAll), ProducedBy = Tool.Trimmer | Tool.NativeAot)]
[ExpectedWarning ("IL2062", nameof (DataFlowTypeExtensions.RequiresAll), ProducedBy = Tool.Trimmer | Tool.NativeAot)]
static void TestArrayElementReferenceAssignment (bool b = true)
Expand All @@ -283,7 +261,7 @@ static void TestArrayElementReferenceAssignment (bool b = true)
[Kept]
[ExpectedWarning ("IL2072", nameof (GetUnknownType), nameof (DataFlowTypeExtensions.RequiresAll))]
[ExpectedWarning ("IL2072", nameof (GetTypeWithPublicConstructors), nameof (DataFlowTypeExtensions.RequiresAll))]
// BUG: illink/nativeaot have an analysis hole here
// ILLink/ILCompiler analysis hole: https://github.com/dotnet/runtime/issues/90335
[ExpectedWarning ("IL2072", nameof (GetTypeWithPublicFields), nameof (DataFlowTypeExtensions.RequiresAll), ProducedBy = Tool.Analyzer)]
[ExpectedWarning ("IL2072", nameof (GetTypeWithPublicFields), nameof (DataFlowTypeExtensions.RequiresAll), ProducedBy = Tool.Analyzer)]
static void TestArrayElementAssignment (bool b = true)
Expand Down