This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add regression test for https://github.com/dotnet/coreclr/issues/26491 (
- Loading branch information
Showing
4 changed files
with
148 additions
and
0 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
129 changes: 129 additions & 0 deletions
129
tests/src/JIT/Regression/JitBlue/GitHub_26491/GitHub_26491.il
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,129 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
|
||
// The test exposes an assertion in gtNewTempAssign on Arm64 when a method | ||
// 1. returns a struct with one field of TYP_SIMD16 (e.g. Vector128<byte>) and | ||
// 2. requires to have a single return basic block; | ||
// this condition becomes true when the method is | ||
// 2.1. synchronized or | ||
// 2.2. needs profiling ELT hooks or | ||
// 2.3. has more than 4 return-points. | ||
// | ||
// The issue is due to: | ||
// 1. importer transforming the return values of each GT_RETURN node | ||
// LCL_VAR struct V00 loc0 | ||
// into | ||
// LCL_FLD simd16 V00 loc0 [+0] | ||
// 2. morph merging the return values of "original" return basic blocks into | ||
// a temp that holds the return value in the new "designated" return basic block. | ||
// During the merge gtNewTempAssign does not expect the source value of TYP_SIMD16 | ||
// and the destination value of TYP_STRUCT. | ||
|
||
.assembly extern System.Runtime | ||
{ | ||
} | ||
|
||
.assembly extern System.Runtime.Intrinsics | ||
{ | ||
} | ||
|
||
.assembly GitHub_26491 | ||
{ | ||
} | ||
|
||
.class private auto ansi beforefieldinit GitHub_26491 extends [System.Runtime]System.Object | ||
{ | ||
.class sequential ansi sealed nested private beforefieldinit ReturnType | ||
extends [System.Runtime]System.ValueType | ||
{ | ||
.field private valuetype [System.Runtime.Intrinsics]System.Runtime.Intrinsics.Vector128`1<uint8> _simd16 | ||
} | ||
|
||
.method private hidebysig static valuetype GitHub_26491/ReturnType MultipleReturns(int32 i) cil managed noinlining | ||
{ | ||
// Code size 74 (0x4a) | ||
.maxstack 1 | ||
.locals init (valuetype GitHub_26491/ReturnType V_0) | ||
IL_0000: ldarg.0 | ||
IL_0001: switch (IL_0018, IL_0022, IL_002c, IL_0036) | ||
IL_0016: br.s IL_0040 | ||
|
||
IL_0018: ldloca.s V_0 | ||
IL_001a: initobj GitHub_26491/ReturnType | ||
IL_0020: ldloc.0 | ||
IL_0021: ret | ||
|
||
IL_0022: ldloca.s V_0 | ||
IL_0024: initobj GitHub_26491/ReturnType | ||
IL_002a: ldloc.0 | ||
IL_002b: ret | ||
|
||
IL_002c: ldloca.s V_0 | ||
IL_002e: initobj GitHub_26491/ReturnType | ||
IL_0034: ldloc.0 | ||
IL_0035: ret | ||
|
||
IL_0036: ldloca.s V_0 | ||
IL_0038: initobj GitHub_26491/ReturnType | ||
IL_003e: ldloc.0 | ||
IL_003f: ret | ||
|
||
IL_0040: ldloca.s V_0 | ||
IL_0042: initobj GitHub_26491/ReturnType | ||
IL_0048: ldloc.0 | ||
IL_0049: ret | ||
} | ||
|
||
.method private hidebysig static valuetype GitHub_26491/ReturnType SingleReturnSynchronized() cil managed synchronized noinlining | ||
{ | ||
.maxstack 1 | ||
.locals init (valuetype GitHub_26491/ReturnType V_0) | ||
IL_0000: ldloca.s V_0 | ||
IL_0002: initobj GitHub_26491/ReturnType | ||
IL_0008: ldloc.0 | ||
IL_0009: ret | ||
} | ||
|
||
.method private hidebysig static valuetype GitHub_26491/ReturnType SingleReturn() cil managed noinlining | ||
{ | ||
.maxstack 1 | ||
.locals init (valuetype GitHub_26491/ReturnType V_0) | ||
IL_0000: ldloca.s V_0 | ||
IL_0002: initobj GitHub_26491/ReturnType | ||
IL_0008: ldloc.0 | ||
IL_0009: ret | ||
} | ||
|
||
.method public hidebysig static int32 Main(string[] args) cil managed | ||
{ | ||
.entrypoint | ||
.maxstack 8 | ||
IL_0000: ldarg.0 | ||
IL_0001: ldstr "MultipleReturns" | ||
IL_0006: call int32 [System.Runtime]System.Array::IndexOf<string>(!!0[], !!0) | ||
IL_000b: ldc.i4.m1 | ||
IL_000c: beq.s IL_001b | ||
|
||
IL_000e: ldc.i4 0x677b | ||
IL_0013: call valuetype GitHub_26491/ReturnType GitHub_26491::MultipleReturns(int32) | ||
IL_0018: pop | ||
IL_0019: br.s IL_0037 | ||
|
||
IL_001b: ldarg.0 | ||
IL_001c: ldstr "SingleReturnSynchronized" | ||
IL_0021: call int32 [System.Runtime]System.Array::IndexOf<string>(!!0[], !!0) | ||
IL_0026: ldc.i4.m1 | ||
IL_0027: beq.s IL_0031 | ||
|
||
IL_0029: call valuetype GitHub_26491/ReturnType GitHub_26491::SingleReturnSynchronized() | ||
IL_002e: pop | ||
IL_002f: br.s IL_0037 | ||
|
||
IL_0031: call valuetype GitHub_26491/ReturnType GitHub_26491::SingleReturn() | ||
IL_0036: pop | ||
IL_0037: ldc.i4.s 100 | ||
IL_0039: ret | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
tests/src/JIT/Regression/JitBlue/GitHub_26491/GitHub_26491_MultipleReturns.ilproj
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.IL"> | ||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<CLRTestExecutionArguments>MultipleReturns</CLRTestExecutionArguments> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="GitHub_26491.il" /> | ||
</ItemGroup> | ||
</Project> |
7 changes: 7 additions & 0 deletions
7
tests/src/JIT/Regression/JitBlue/GitHub_26491/GitHub_26491_SingleReturnSynchronized.ilproj
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,7 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.IL"> | ||
<PropertyGroup> | ||
<CLRTestKind>RunOnly</CLRTestKind> | ||
<CLRTestProjectToRun>GitHub_26491_MultipleReturns.ilproj</CLRTestProjectToRun> | ||
<CLRTestExecutionArguments>SingleReturnSynchronized</CLRTestExecutionArguments> | ||
</PropertyGroup> | ||
</Project> |