Skip to content

Commit 15be0fe

Browse files
committed
Add regression test
1 parent e405e94 commit 15be0fe

File tree

3 files changed

+124
-0
lines changed

3 files changed

+124
-0
lines changed
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
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 Xunit;
5+
6+
// Generated by Fuzzlyn v1.5 on 2023-08-05 16:08:41
7+
// Run on X86 Windows
8+
// Seed: 7610693270284065118
9+
// Reduced from 12.0 KiB to 2.2 KiB in 00:01:06
10+
// Debug: Outputs 1
11+
// Release: Outputs 2
12+
public interface I0
13+
{
14+
}
15+
16+
public class C0 : I0
17+
{
18+
public ulong F0;
19+
public uint F4;
20+
public C0(ulong f0, uint f4)
21+
{
22+
F0 = f0;
23+
F4 = f4;
24+
}
25+
}
26+
27+
public class Runtime_90219
28+
{
29+
public static IRuntime s_rt;
30+
public static I0 s_1;
31+
public static uint s_2;
32+
public static byte[] s_4 = new byte[]{0};
33+
public static byte Result;
34+
35+
[Fact]
36+
public static int TestEntryPoint()
37+
{
38+
CollectibleALC alc = new CollectibleALC();
39+
System.Reflection.Assembly asm = alc.LoadFromAssemblyPath(System.Reflection.Assembly.GetExecutingAssembly().Location);
40+
System.Reflection.MethodInfo mi = asm.GetType(typeof(Runtime_90219).FullName).GetMethod(nameof(MainInner));
41+
System.Type runtimeTy = asm.GetType(typeof(Runtime).FullName);
42+
return (int)mi.Invoke(null, new object[]{System.Activator.CreateInstance(runtimeTy)});
43+
}
44+
45+
public static int MainInner(IRuntime rt)
46+
{
47+
s_rt = rt;
48+
var vr8 = new C0(0, 0);
49+
var vr12 = s_4[0];
50+
vr8.F0 *= M2(vr12);
51+
long[] vr9 = new long[]{0};
52+
bool vr10 = (int)M2(0) <= vr9[0];
53+
return Result == 1 ? 100 : 101;
54+
}
55+
56+
public static ulong M2(byte arg0)
57+
{
58+
for (int var0 = 0; var0 < 2; var0++)
59+
{
60+
var vr1 = new C0(0, 0);
61+
var vr3 = new C0(0, 0);
62+
uint vr14 = s_2;
63+
s_rt.WriteLine("c_0", vr14);
64+
uint vr15 = vr3.F4;
65+
s_2 = M3(vr1, vr15);
66+
s_1 = s_1;
67+
s_1 = new C0(0, 0);
68+
s_rt.WriteLine("c_6", var0);
69+
}
70+
71+
var vr5 = new C0(0, 1);
72+
uint vr18 = vr5.F4;
73+
arg0 = (byte)vr18;
74+
var vr7 = new C0(0, 1838341904U);
75+
if ((arg0 >= (byte)M3(vr7, 0)))
76+
{
77+
arg0 <<= 1;
78+
}
79+
80+
s_rt.WriteLine("c_7", arg0);
81+
return 0;
82+
}
83+
84+
public static uint M3(C0 argThis, uint arg0)
85+
{
86+
s_rt.WriteLine("c_0", arg0);
87+
return argThis.F4;
88+
}
89+
}
90+
91+
public interface IRuntime
92+
{
93+
void WriteLine<T>(string site, T value);
94+
}
95+
96+
public class Runtime : IRuntime
97+
{
98+
public void WriteLine<T>(string site, T value)
99+
{
100+
if (typeof(T) == typeof(byte))
101+
Runtime_90219.Result = (byte)(object)value;
102+
}
103+
}
104+
105+
public class CollectibleALC : System.Runtime.Loader.AssemblyLoadContext
106+
{
107+
public CollectibleALC(): base(true)
108+
{
109+
}
110+
}
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>

src/tests/issues.targets

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,6 +1069,9 @@
10691069
<ExcludeList Include="$(XunitTestBinBase)/JIT/Regression/JitBlue/Runtime_76273/Runtime_76273/**">
10701070
<Issue>https://github.com/dotnet/runtimelab/issues/155: Assembly.Load</Issue>
10711071
</ExcludeList>
1072+
<ExcludeList Include="$(XunitTestBinBase)/JIT/Regression/JitBlue/Runtime_90219/Runtime_90219/**">
1073+
<Issue>https://github.com/dotnet/runtimelab/issues/155: Assembly.Load</Issue>
1074+
</ExcludeList>
10721075
<ExcludeList Include="$(XunitTestBinBase)/reflection\DefaultInterfaceMethods\Emit\*">
10731076
<Issue>https://github.com/dotnet/runtimelab/issues/155: Reflection.Emit</Issue>
10741077
</ExcludeList>
@@ -3388,6 +3391,9 @@
33883391
<ExcludeList Include="$(XunitTestBinBase)/Loader/StartupHooks/**">
33893392
<Issue>Loads an assembly from file</Issue>
33903393
</ExcludeList>
3394+
<ExcludeList Include="$(XunitTestBinBase)/JIT/Regression/JitBlue/Runtime_90219/Runtime_90219/*">
3395+
<Issue>Loads an assembly from file</Issue>
3396+
</ExcludeList>
33913397
</ItemGroup>
33923398

33933399
<ItemGroup Condition="'$(TargetArchitecture)' == 'wasm'">

0 commit comments

Comments
 (0)