-
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.
- Loading branch information
1 parent
3cfd7a0
commit 10166f5
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
src/tests/JIT/Regression/JitBlue/Runtime_70466/Runtime_70466.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,38 @@ | ||
// 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_70466 | ||
{ | ||
public static int Main() | ||
{ | ||
Problem(1, 0); | ||
return 100; | ||
} | ||
|
||
// This method is carefully crafted such that we end up with an unused ARR_ADDR node by rationalization | ||
// time, of which the child operand will need to be explicitly marked "unused value" for LIR purposes. | ||
// | ||
[MethodImpl(MethodImplOptions.NoInlining)] | ||
private static void Problem(byte b, int idx) | ||
{ | ||
var a = new byte[] { b }; | ||
var a1 = new byte[] { b, b }; | ||
var a2 = new byte[] { b, b, b }; | ||
|
||
if (idx == 0) | ||
{ | ||
if (a[idx] == 1) | ||
{ | ||
Use(1); | ||
} | ||
JitUse(a1[idx] + a2[idx]); | ||
} | ||
} | ||
|
||
public static void Use<T>(T arg) { } | ||
|
||
[MethodImpl(MethodImplOptions.NoInlining)] | ||
public static void JitUse<T>(T arg) { } | ||
} |
9 changes: 9 additions & 0 deletions
9
src/tests/JIT/Regression/JitBlue/Runtime_70466/Runtime_70466.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,9 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<Optimize>True</Optimize> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="$(MSBuildProjectName).cs" /> | ||
</ItemGroup> | ||
</Project> |