diff options
author | Mike Danes <onemihaid@hotmail.com> | 2017-08-19 11:59:24 +0300 |
---|---|---|
committer | Mike Danes <onemihaid@hotmail.com> | 2017-08-19 20:35:52 +0300 |
commit | d93735c280e2f4d4444d4b385eca3fe9f3677761 (patch) | |
tree | 1327cf72060197f4cd9aff62eba6d9a2c4b5750e /tests | |
parent | 5dada64d4bc9eddb63579650e1fce4f5ffda0294 (diff) | |
download | coreclr-d93735c280e2f4d4444d4b385eca3fe9f3677761.tar.gz coreclr-d93735c280e2f4d4444d4b385eca3fe9f3677761.tar.bz2 coreclr-d93735c280e2f4d4444d4b385eca3fe9f3677761.zip |
Fix incorrect switch temp lcl type
Diffstat (limited to 'tests')
-rw-r--r-- | tests/src/JIT/Regression/JitBlue/GitHub_13486/GitHub_13486.cs | 33 | ||||
-rw-r--r-- | tests/src/JIT/Regression/JitBlue/GitHub_13486/GitHub_13486.csproj | 25 |
2 files changed, 58 insertions, 0 deletions
diff --git a/tests/src/JIT/Regression/JitBlue/GitHub_13486/GitHub_13486.cs b/tests/src/JIT/Regression/JitBlue/GitHub_13486/GitHub_13486.cs new file mode 100644 index 0000000000..cb4bd4e2b6 --- /dev/null +++ b/tests/src/JIT/Regression/JitBlue/GitHub_13486/GitHub_13486.cs @@ -0,0 +1,33 @@ +// 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.Runtime.CompilerServices; + +class Program +{ + enum LongEnum : long + { + Option0, Option1, Option2 + } + + [MethodImpl(MethodImplOptions.NoInlining)] + static string Test(LongEnum v) + { + string s; + switch (v) + { + case LongEnum.Option0: s = "Option0"; break; + case LongEnum.Option1: s = "Option1"; break; + case LongEnum.Option2: s = "Option2"; break; + default: throw new Exception(); + } + return s; + } + + static int Main() + { + return (Test(LongEnum.Option0) == "Option0") ? 100 : 1; + } +} diff --git a/tests/src/JIT/Regression/JitBlue/GitHub_13486/GitHub_13486.csproj b/tests/src/JIT/Regression/JitBlue/GitHub_13486/GitHub_13486.csproj new file mode 100644 index 0000000000..4bf984a832 --- /dev/null +++ b/tests/src/JIT/Regression/JitBlue/GitHub_13486/GitHub_13486.csproj @@ -0,0 +1,25 @@ +<?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)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <AssemblyName>$(MSBuildProjectName)</AssemblyName> + <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid> + <OutputType>Exe</OutputType> + <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> + <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + </PropertyGroup> + <PropertyGroup> + <DebugType></DebugType> + <Optimize>False</Optimize> + </PropertyGroup> + <ItemGroup> + <Compile Include="$(MSBuildProjectName).cs" /> + </ItemGroup> + <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" /> +</Project> |