summaryrefslogtreecommitdiff
path: root/tests/src/JIT
diff options
context:
space:
mode:
authorBrian Sullivan <briansul@microsoft.com>2018-03-09 10:59:41 -0800
committerBrian Sullivan <briansul@microsoft.com>2018-03-09 10:59:41 -0800
commitdf056a2a5cfa3939af508d1ca281d874a6f93823 (patch)
tree56527fda0d2af336bc81c85b9deafa970a97f285 /tests/src/JIT
parentbc3b01b5612b21fdb8f11ec6917e5ec4503f1dcc (diff)
downloadcoreclr-df056a2a5cfa3939af508d1ca281d874a6f93823.tar.gz
coreclr-df056a2a5cfa3939af508d1ca281d874a6f93823.tar.bz2
coreclr-df056a2a5cfa3939af508d1ca281d874a6f93823.zip
When value numbering an assignment we may need to insert an implicit cast operation
Test case opt/CSE/NarrowStore.cs added
Diffstat (limited to 'tests/src/JIT')
-rw-r--r--tests/src/JIT/opt/CSE/NarrowStore.cs39
-rw-r--r--tests/src/JIT/opt/CSE/NarrowStore.csproj35
2 files changed, 74 insertions, 0 deletions
diff --git a/tests/src/JIT/opt/CSE/NarrowStore.cs b/tests/src/JIT/opt/CSE/NarrowStore.cs
new file mode 100644
index 0000000000..386a56c581
--- /dev/null
+++ b/tests/src/JIT/opt/CSE/NarrowStore.cs
@@ -0,0 +1,39 @@
+// 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;
+
+namespace NarrowStore
+{
+ class Program
+ {
+ byte x01;
+ byte t01;
+
+ int Test()
+ {
+ x01 = 3;
+ t01 = (byte)~x01;
+ if (t01 == 252)
+ {
+ Console.WriteLine("Pass");
+ return 100;
+ }
+ else
+ {
+ Console.WriteLine("FAIL");
+ return -1;
+ }
+ }
+
+ static int Main(string[] args)
+ {
+ Program prog = new Program();
+
+ int result = prog.Test();
+ return result;
+ }
+ }
+}
+
diff --git a/tests/src/JIT/opt/CSE/NarrowStore.csproj b/tests/src/JIT/opt/CSE/NarrowStore.csproj
new file mode 100644
index 0000000000..df5bf2351e
--- /dev/null
+++ b/tests/src/JIT/opt/CSE/NarrowStore.csproj
@@ -0,0 +1,35 @@
+<?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>
+ <SchemaVersion>2.0</SchemaVersion>
+ <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>
+ <CLRTestPriority>0</CLRTestPriority>
+ </PropertyGroup>
+ <!-- Default configurations to help VS understand the configurations -->
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "></PropertyGroup>
+ <ItemGroup>
+ <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+ <Visible>False</Visible>
+ </CodeAnalysisDependentAssemblyPaths>
+ </ItemGroup>
+ <PropertyGroup>
+ <DebugType>None</DebugType>
+ <Optimize>True</Optimize>
+ </PropertyGroup>
+ <ItemGroup>
+ <Compile Include="NarrowStore.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+ </ItemGroup>
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+ <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+</Project> \ No newline at end of file