Skip to content

Commit c97cea2

Browse files
AndyAyersMSgithub-actions
authored andcommitted
add test that fails for ref type arrays
1 parent 704128b commit c97cea2

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

src/tests/JIT/Regression/JitBlue/Runtime_120270/Runtime_120270.cs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33

44
using System;
5+
using System.Collections.Generic;
56
using System.Linq;
67
using System.Runtime.CompilerServices;
78
using Xunit;
@@ -66,5 +67,29 @@ static void Foo<T>(object[] x)
6667
}
6768
}
6869
}
70+
71+
[Fact]
72+
public static int TestEntryPoint3()
73+
{
74+
for (int i = 0; i < 100_000; i++)
75+
{
76+
Derived[] d = [new Derived()];
77+
IEnumerable<Base> e = d;
78+
IEnumerator<Base> en = e.GetEnumerator();
79+
string s = en.GetType().ToString();
80+
81+
if (i == 0)
82+
{
83+
Console.WriteLine($"Enumerator type: {s}");
84+
}
85+
86+
if (!s.Equals("System.SZGenericArrayEnumerator`1[Base]"))
87+
{
88+
Console.WriteLine($"Enumerator type changed at {i} to {s}");
89+
return -1;
90+
}
91+
}
92+
return 100;
93+
}
6994
}
7095

0 commit comments

Comments
 (0)