Skip to content

Commit 72efb9c

Browse files
authored
Add test case for RavenDB's AV issue (#89493)
1 parent bc23bf4 commit 72efb9c

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
4+
using System;
5+
using System.Runtime.CompilerServices;
6+
using Xunit;
7+
8+
public class Runtime_87597
9+
{
10+
interface IFace
11+
{
12+
static IFace() {}
13+
void Method();
14+
}
15+
16+
class GenericType<T> : IFace
17+
{
18+
static GenericType()
19+
{
20+
}
21+
22+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
23+
public void Method()
24+
{
25+
}
26+
}
27+
28+
[MethodImpl(MethodImplOptions.NoInlining)]
29+
static void TestL1(IFace iface)
30+
{
31+
iface.Method();
32+
}
33+
34+
[Fact]
35+
public static int TestEntryPoint()
36+
{
37+
for (int i = 0; i < 100; i++)
38+
{
39+
System.Threading.Thread.Sleep(16);
40+
TestL1(new GenericType<string>());
41+
}
42+
43+
return 100;
44+
}
45+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<Optimize>True</Optimize>
4+
</PropertyGroup>
5+
<ItemGroup>
6+
<Compile Include="$(MSBuildProjectName).cs" />
7+
</ItemGroup>
8+
</Project>

0 commit comments

Comments
 (0)