summaryrefslogtreecommitdiff
path: root/tests/src/JIT
diff options
context:
space:
mode:
authorCarol Eidt <carol.eidt@microsoft.com>2019-04-02 15:54:26 -0700
committerGitHub <noreply@github.com>2019-04-02 15:54:26 -0700
commitf036d2339b030258bf31bc73ebc23f553744fa04 (patch)
tree5286353048b68608ad94c9d08b81ce52a6733899 /tests/src/JIT
parent8053b7db57a6b95fa61f7c22f8bfcd277ef136bd (diff)
downloadcoreclr-f036d2339b030258bf31bc73ebc23f553744fa04.tar.gz
coreclr-f036d2339b030258bf31bc73ebc23f553744fa04.tar.bz2
coreclr-f036d2339b030258bf31bc73ebc23f553744fa04.zip
Fix spill check for struct lclVars (#23570)
* Fix spill check for struct lclVars 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
Diffstat (limited to 'tests/src/JIT')
-rw-r--r--tests/src/JIT/Regression/JitBlue/GitHub_23545/GitHub_23545.cs50
-rw-r--r--tests/src/JIT/Regression/JitBlue/GitHub_23545/GitHub_23545.csproj17
2 files changed, 67 insertions, 0 deletions
diff --git a/tests/src/JIT/Regression/JitBlue/GitHub_23545/GitHub_23545.cs b/tests/src/JIT/Regression/JitBlue/GitHub_23545/GitHub_23545.cs
new file mode 100644
index 0000000000..3ea3d97fa7
--- /dev/null
+++ b/tests/src/JIT/Regression/JitBlue/GitHub_23545/GitHub_23545.cs
@@ -0,0 +1,50 @@
+// 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
+{
+ 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;
+ }
+ }
+}
diff --git a/tests/src/JIT/Regression/JitBlue/GitHub_23545/GitHub_23545.csproj b/tests/src/JIT/Regression/JitBlue/GitHub_23545/GitHub_23545.csproj
new file mode 100644
index 0000000000..c24f74b865
--- /dev/null
+++ b/tests/src/JIT/Regression/JitBlue/GitHub_23545/GitHub_23545.csproj
@@ -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>