diff options
author | Eugene Rozenfeld <erozen@microsoft.com> | 2016-04-21 13:22:46 -0700 |
---|---|---|
committer | Eugene Rozenfeld <erozen@microsoft.com> | 2016-04-21 13:22:46 -0700 |
commit | 51b42ad4e567a9895f151e201b62e1e6b2c5a80d (patch) | |
tree | 5da17d994dcff31faede7ba3fca86288f2ef324d /tests/src/JIT | |
parent | 06392c8b0bc0e0c03b41ec1e71e5ee97b34749c9 (diff) | |
parent | 4d817943e480d61c0de420e740a9d66f884adab9 (diff) | |
download | coreclr-51b42ad4e567a9895f151e201b62e1e6b2c5a80d.tar.gz coreclr-51b42ad4e567a9895f151e201b62e1e6b2c5a80d.tar.bz2 coreclr-51b42ad4e567a9895f151e201b62e1e6b2c5a80d.zip |
Merge pull request #4399 from erozenfeld/HandleConstantProp
Don't perform constant propagation when relocatable handles are involved
Diffstat (limited to 'tests/src/JIT')
3 files changed, 169 insertions, 0 deletions
diff --git a/tests/src/JIT/Regression/JitBlue/DevDiv_206786/app.config b/tests/src/JIT/Regression/JitBlue/DevDiv_206786/app.config new file mode 100644 index 0000000000..6f7bbd9d2b --- /dev/null +++ b/tests/src/JIT/Regression/JitBlue/DevDiv_206786/app.config @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="utf-8"?> +<configuration> + <runtime> + <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> + <dependentAssembly> + <assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.20.0" newVersion="4.0.20.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Text.Encoding" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.IO" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Reflection" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" /> + </dependentAssembly> + </assemblyBinding> + </runtime> +</configuration> diff --git a/tests/src/JIT/Regression/JitBlue/DevDiv_206786/handleMath.il b/tests/src/JIT/Regression/JitBlue/DevDiv_206786/handleMath.il new file mode 100644 index 0000000000..18c76afbd9 --- /dev/null +++ b/tests/src/JIT/Regression/JitBlue/DevDiv_206786/handleMath.il @@ -0,0 +1,93 @@ +// 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. + +// Need to be careful about constant folding and handles +// during prejitting. + +.assembly extern mscorlib {} +.assembly handleMath {} +.module handleMath.exe + +.class public F +{ + +.method public instance void .ctor(int32 a) +{ + ldarg.0 + call instance void [mscorlib]System.Object::.ctor() + ldarg.0 + ldarg.1 + ldc.i4 75 + add + stfld int32 F::A + ret +} + +.field public int32 A + +.method public int32 Fix() cil +{ + ldarg.0 + ldfld int32 F::A + ldc.i4 125 + add + ret +} + +.method public static native int Add(native int x) cil managed +{ + ldarg.0 + ldc.i4 5 + add + ret +} + +.method public static native int Sub(native int x) cil managed noinlining +{ + ldarg.0 + ldc.i4 5 + sub + ret +} + +.method public hidebysig static int32 Main(string[] args) cil managed +{ + .entrypoint + ldc.i4 -100 + newobj instance void F::.ctor(int32) + ldftn instance int32 F::Fix() + call native int F::Add(native int) + call native int F::Sub(native int) + calli int32(class F) + ldc.i4 100 + bne.un failure + + ldc.i4 -100 + newobj instance void F::.ctor(int32) + ldftn instance int32 F::Fix() + neg + neg + calli int32(class F) + ldc.i4 100 + bne.un failure + + ldc.i4 -100 + newobj instance void F::.ctor(int32) + ldftn instance int32 F::Fix() + not + not + calli int32(class F) + ldc.i4 100 + bne.un failure + +success: + ldc.i4 100 + ret +failure: + ldc.i4.0 + ret +} + + +} diff --git a/tests/src/JIT/Regression/JitBlue/DevDiv_206786/handleMath.ilproj b/tests/src/JIT/Regression/JitBlue/DevDiv_206786/handleMath.ilproj new file mode 100644 index 0000000000..23d94cbc86 --- /dev/null +++ b/tests/src/JIT/Regression/JitBlue/DevDiv_206786/handleMath.ilproj @@ -0,0 +1,49 @@ +<?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> + <AppDesignerFolder>Properties</AppDesignerFolder> + <FileAlignment>512</FileAlignment> + <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> + <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath> + <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir> + <RestorePackages>true</RestorePackages> + <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp> + </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>PdbOnly</DebugType> + </PropertyGroup> + <ItemGroup> + <Compile Include="handleMath.il" /> + </ItemGroup> + <ItemGroup> + <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" /> + <None Include="app.config" /> + </ItemGroup> + <ItemGroup> + <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" /> + </ItemGroup> + <PropertyGroup> + <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson> + <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson> + </PropertyGroup> + <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" /> + <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "> + </PropertyGroup> +</Project> |