Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/linker.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJackson Schuster <36744439+jtschuster@users.noreply.github.com>2022-03-24 01:48:30 +0300
committerGitHub <noreply@github.com>2022-03-24 01:48:30 +0300
commit04c49c9d7c244d7c73d6dbb438c4885fa72e830b (patch)
treefa4a92f074b41c137e29578f4443d004514e4842 /test
parent5d8277a86cb5dd9027ea5b31207e843d31fc3f9d (diff)
Update array data flow test (#2704)
* Fix array dataflow test for passing ref to element
Diffstat (limited to 'test')
-rw-r--r--test/Mono.Linker.Tests.Cases/DataFlow/ArrayDataFlow.cs11
1 files changed, 7 insertions, 4 deletions
diff --git a/test/Mono.Linker.Tests.Cases/DataFlow/ArrayDataFlow.cs b/test/Mono.Linker.Tests.Cases/DataFlow/ArrayDataFlow.cs
index 75829c1f8..3ea97012e 100644
--- a/test/Mono.Linker.Tests.Cases/DataFlow/ArrayDataFlow.cs
+++ b/test/Mono.Linker.Tests.Cases/DataFlow/ArrayDataFlow.cs
@@ -161,16 +161,19 @@ namespace Mono.Linker.Tests.Cases.DataFlow
// https://github.com/dotnet/linker/issues/2680 - analyzer doesn't reset array in this case
[ExpectedWarning ("IL2062", nameof (DataFlowTypeExtensions.RequiresPublicFields), ProducedBy = ProducedBy.Trimmer)]
+ // https://github.com/dotnet/linker/issues/2632 - Ref params don't reset or track.
+ // [ExpectedWarning ("IL2062", nameof (DataFlowTypeExtensions.RequiresPublicMethods))]
static void TestArrayResetGetElementOnByRefArray (int i = 0)
{
- Type[] arr = new Type[] { typeof (TestType) };
+ Type[] arr = new Type[] { typeof (TestType), typeof (TestType) };
arr[0].RequiresPublicProperties ();
- TakesTypeByRef (ref arr[0]); // No reset - known index
- arr[0].RequiresPublicMethods (); // Doesn't warn
+ TakesTypeByRef (ref arr[0]); // Should reset index 0 - linker doesn't
+ arr[0].RequiresPublicMethods (); // Should warn -- linker doesn't
+ arr[1].RequiresPublicMethods (); // Shouldn't warn
TakesTypeByRef (ref arr[i]); // Reset - unknown index
- arr[0].RequiresPublicFields (); // Warns
+ arr[1].RequiresPublicFields (); // Warns
}
static void TakesTypeByRef (ref Type type) { }