diff options
Diffstat (limited to 'tests/src/JIT')
-rw-r--r-- | tests/src/JIT/Regression/JitBlue/GitHub_23545/GitHub_23545.cs | 50 | ||||
-rw-r--r-- | tests/src/JIT/Regression/JitBlue/GitHub_23545/GitHub_23545.csproj | 17 |
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> |