-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RefTypeZeroInit doesn't need treeNode (#56333)
* RefTypeZeroInit doesn't need treeNode * Add a test case
- Loading branch information
1 parent
c62ece8
commit 6d35185
Showing
3 changed files
with
69 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
src/tests/JIT/Regression/JitBlue/Runtime_54100/Runtime_54100.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System.Runtime.CompilerServices; | ||
|
||
public class Runtime_54100 | ||
{ | ||
// The test ends up containing an empty try block and we do not find a | ||
// non-empty block from which a treeNode can be extracted to use it for | ||
// creating zero-init refPositions. | ||
|
||
static ushort[][] s_23 = new ushort[][]{new ushort[]{0}}; | ||
static short s_32; | ||
static short s_33; | ||
static int s_45; | ||
public static int Main() | ||
{ | ||
ushort[] vr4 = s_23[0]; | ||
return (int)M45(); | ||
} | ||
|
||
[MethodImpl(MethodImplOptions.NoInlining)] | ||
static ushort M45() | ||
{ | ||
short var0; | ||
try | ||
{ | ||
var0 = s_32; | ||
} | ||
finally | ||
{ | ||
var0 = s_33; | ||
int var1 = s_45; | ||
ulong vr8 = default(ulong); | ||
var0 = (short)((sbyte)vr8 - var0); | ||
try | ||
{ | ||
M46(); | ||
} | ||
finally | ||
{ | ||
M46(); | ||
} | ||
|
||
System.Console.WriteLine(var1); | ||
} | ||
|
||
return 100; | ||
} | ||
|
||
static ulong M46() | ||
{ | ||
return default(ulong); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/tests/JIT/Regression/JitBlue/Runtime_54100/Runtime_54100.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<Optimize>True</Optimize> | ||
<DebugType>None</DebugType> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="$(MSBuildProjectName).cs" /> | ||
</ItemGroup> | ||
</Project> |