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.
With the 1st class struct changes, the `SPILL_APPEND` check for the case of an assignment to a lclVar needs to handle block ops as well as lclVar lhs. Fix #23545
- Loading branch information
Showing
4 changed files
with
85 additions
and
7 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
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
53 changes: 53 additions & 0 deletions
53
tests/src/JIT/Regression/JitBlue/GitHub_23545/GitHub_23545.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,53 @@ | ||
// 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. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace GitHub_23545 | ||
{ | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
public struct TestStruct | ||
{ | ||
public int value1; | ||
|
||
public override string ToString() | ||
{ | ||
return this.value1.ToString(); | ||
} | ||
} | ||
|
||
class Test | ||
{ | ||
public static Dictionary<TestStruct, TestStruct> StructKeyValue | ||
{ | ||
get | ||
{ | ||
return new Dictionary<TestStruct, TestStruct>() | ||
{ | ||
{ | ||
new TestStruct(){value1 = 12}, new TestStruct(){value1 = 15} | ||
} | ||
}; | ||
} | ||
} | ||
|
||
static int Main() | ||
{ | ||
int value = 0; | ||
foreach (var e in StructKeyValue) | ||
{ | ||
value += e.Key.value1 + e.Value.value1; | ||
Console.WriteLine(e.Key.ToString() + " " + e.Value.ToString()); | ||
} | ||
if (value != 27) | ||
{ | ||
return -1; | ||
} | ||
return 100; | ||
} | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
tests/src/JIT/Regression/JitBlue/GitHub_23545/GitHub_23545.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,17 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" /> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<AssemblyName>$(MSBuildProjectName)</AssemblyName> | ||
<OutputType>Exe</OutputType> | ||
<DebugType></DebugType> | ||
<Optimize>True</Optimize> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="$(MSBuildProjectName).cs" /> | ||
</ItemGroup> | ||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" /> | ||
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup> | ||
</Project> |