diff options
Diffstat (limited to 'tests/src/JIT/Regression')
6 files changed, 401 insertions, 0 deletions
diff --git a/tests/src/JIT/Regression/JitBlue/DevDiv_397793/DevDiv_397793.il b/tests/src/JIT/Regression/JitBlue/DevDiv_397793/DevDiv_397793.il new file mode 100644 index 0000000000..95d40b6bed --- /dev/null +++ b/tests/src/JIT/Regression/JitBlue/DevDiv_397793/DevDiv_397793.il @@ -0,0 +1,147 @@ +// 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. + +.assembly extern mscorlib{} +.assembly ILGEN_MODULE{} + +// This test originally failed compilation during CSE due to value numbers that were discarded during remorphing. +// The arguments to and return value from `ILGEN_METHOD` are not meaningful; it is enough that this function +// compiles successfully. + +.class ILGEN_CLASS +{ + .method static float32 ILGEN_METHOD(int16, char, char, native int) + { + .maxstack 65535 + .locals init (int8, native unsigned int, int64, int8, bool, unsigned int64, char, float64, int64, native int, float32, int64, int64, unsigned int16) + + IL_0000: ldloc 0x000d + IL_0004: not + IL_0005: ldloc.s 0x06 + IL_0007: cgt.un + IL_0009: ldloc.s 0x06 + IL_000b: clt.un + IL_000d: conv.r4 + IL_000e: ldloc.s 0x08 + IL_0010: conv.r.un + IL_0011: mul + IL_0012: conv.i8 + IL_0013: ldloc.s 0x03 + IL_0015: conv.u1 + IL_0016: not + IL_0017: ldloc.s 0x00 + IL_0019: ldloc.s 0x07 + IL_001b: neg + IL_001c: conv.u1 + IL_001d: xor + IL_001e: sub + IL_001f: ldloc 0x000c + IL_0023: neg + IL_0024: conv.i8 + IL_0025: ldloc.s 0x07 + IL_0027: neg + IL_0028: conv.u8 + IL_0029: conv.i8 + IL_002a: ldc.i4 0x2487c9b5 + IL_002f: conv.i8 + IL_0030: rem.un + IL_0031: ldloc.s 0x09 + IL_0033: conv.i8 + IL_0034: ldloc.s 0x01 + IL_0036: neg + IL_0037: not + IL_0038: ldloc 0x0006 + IL_003c: mul + IL_003d: shr.un + IL_003e: add + IL_003f: ldloc.s 0x0b + IL_0041: conv.i4 + IL_0042: shr.un + IL_0043: ldarg.s 0x03 + IL_0045: conv.i4 + IL_0046: ldloc.s 0x00 + IL_0048: clt + IL_004a: neg + IL_004b: ldloc.s 0x09 + IL_004d: pop + IL_004e: conv.r.un + IL_004f: conv.u8 + IL_0050: ldloc.s 0x05 + IL_0052: mul + IL_0053: ldloc.s 0x0c + IL_0055: conv.i8 + IL_0056: not + IL_0057: cgt.un + IL_0059: neg + IL_005a: nop + IL_005b: shl + IL_005c: ldc.i8 0x6ddee7e52bcb7a50 + IL_0065: ldloc 0x0004 + IL_0069: shr.un + IL_006a: pop + IL_006b: and + IL_006c: conv.u2 + IL_006d: add + IL_006e: ldarg.s 0x02 + IL_0070: not + IL_0071: neg + IL_0072: pop + IL_0073: ldarg.s 0x01 + IL_0075: ldloc 0x0008 + IL_0079: ldloc 0x000b + IL_007d: clt + IL_007f: conv.r.un + IL_0080: pop + IL_0081: ldloc 0x000c + IL_0085: not + IL_0086: ldloc.s 0x0c + IL_0088: conv.u8 + IL_0089: mul + IL_008a: ldloc 0x000b + IL_008e: add + IL_008f: ldloc 0x0002 + IL_0093: ldloc.s 0x0b + IL_0095: rem + IL_0096: ldc.i8 0xfe6f83985a745065 + IL_009f: add + IL_00a0: neg + IL_00a1: cgt.un + IL_00a3: shr + IL_00a4: conv.u8 + IL_00a5: nop + IL_00a6: neg + IL_00a7: neg + IL_00a8: pop + IL_00a9: shr + IL_00aa: nop + IL_00ab: conv.r.un + IL_00ac: ret + } + + .method public static int32 Main() + { + .entrypoint + + .try + { + ldc.i4 0 + ldc.i4 0 + ldc.i4 0 + ldc.i4 0 + conv.i + call float32 ILGEN_CLASS::ILGEN_METHOD(int16, char, char, native int) + pop + leave done + } + catch [mscorlib]System.Exception + { + pop + leave done + } + + done: + ldc.i4 100 + ret + } +} diff --git a/tests/src/JIT/Regression/JitBlue/DevDiv_397793/DevDiv_397793.ilproj b/tests/src/JIT/Regression/JitBlue/DevDiv_397793/DevDiv_397793.ilproj new file mode 100644 index 0000000000..c722432ef9 --- /dev/null +++ b/tests/src/JIT/Regression/JitBlue/DevDiv_397793/DevDiv_397793.ilproj @@ -0,0 +1,34 @@ +<?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> + </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> + <Optimize>True</Optimize> + </PropertyGroup> + <ItemGroup> + <Compile Include="DevDiv_397793.il" /> + </ItemGroup> + <ItemGroup> + <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" /> + </ItemGroup> + <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" /> + <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup> +</Project> diff --git a/tests/src/JIT/Regression/JitBlue/DevDiv_406160/DevDiv_406160.il b/tests/src/JIT/Regression/JitBlue/DevDiv_406160/DevDiv_406160.il new file mode 100644 index 0000000000..a7eaea4def --- /dev/null +++ b/tests/src/JIT/Regression/JitBlue/DevDiv_406160/DevDiv_406160.il @@ -0,0 +1,83 @@ +// 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. + + +// Metadata version: v4.0.30319 +.assembly extern System.Runtime +{ + .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: + .ver 4:2:0:0 +} +.assembly extern System.Console +{ + .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: + .ver 4:1:0:0 +} +.assembly DevDiv_406160 +{ +} + +.class private auto ansi beforefieldinit Bug.Program + extends [System.Runtime]System.Object +{ + .method static char ILGEN_METHOD(int16, unsigned int16, native unsigned int) + { + .maxstack 65535 + .locals init (bool, int64, native unsigned int) + IL_0000: ldarg.s 0x00 + IL_0002: ldc.i4.1 + IL_0015: clt + IL_001b: starg.s 0x00 + IL_001d: ldloc 0x0001 + IL_0067: ldc.i8 0xc3ec93cfd869ae83 + IL_0072: ldc.r8 float64(0xb47a62a75e195a1c) + IL_007c: conv.ovf.u8 + IL_007d: ldc.i4.1 + IL_0081: conv.ovf.i8.un + IL_0088: div.un + IL_0089: add.ovf.un + IL_008c: ldloc 0x0001 + IL_009a: ldc.i8 0x97a27f9613c909c1 + IL_00a3: dup + IL_00a4: clt + IL_00a6: shr.un + IL_00a7: xor + IL_00a8: ldarg.s 0x00 + IL_00aa: conv.ovf.u8.un + IL_00ab: and + IL_00ac: ldloc.s 0x01 + IL_00ae: and + IL_00af: conv.ovf.i2.un + IL_00b0: xor + IL_00cd: conv.i4 + IL_00ce: ret + } + + .method public hidebysig static int32 Main() cil managed + { + .entrypoint + // Code size 22 (0x16) + .maxstack 8 + IL_0001: ldc.i4.0 + IL_0002: ldc.i4.0 + IL_0003: ldc.i4.0 + IL_0004: call char Bug.Program::ILGEN_METHOD(int16, unsigned int16, native unsigned int) + IL_0005: pop + IL_0009: ldstr "Pass" + IL_000e: call void [System.Console]System.Console::WriteLine(string) + IL_0013: ldc.i4.s 100 + IL_0015: ret + } // end of method Program::Main + + .method public hidebysig specialname rtspecialname + instance void .ctor() cil managed + { + // Code size 7 (0x7) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void [System.Runtime]System.Object::.ctor() + IL_0006: ret + } // end of method Program::.ctor + +} // end of class Bug.Program
\ No newline at end of file diff --git a/tests/src/JIT/Regression/JitBlue/DevDiv_406160/DevDiv_406160.ilproj b/tests/src/JIT/Regression/JitBlue/DevDiv_406160/DevDiv_406160.ilproj new file mode 100644 index 0000000000..310db80682 --- /dev/null +++ b/tests/src/JIT/Regression/JitBlue/DevDiv_406160/DevDiv_406160.ilproj @@ -0,0 +1,37 @@ +<?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> + </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="DevDiv_406160.il" /> + </ItemGroup> + <ItemGroup> + <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" /> + </ItemGroup> + <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" /> + <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "> + </PropertyGroup> +</Project> diff --git a/tests/src/JIT/Regression/JitBlue/GitHub_10940/GitHub_10940.cs b/tests/src/JIT/Regression/JitBlue/GitHub_10940/GitHub_10940.cs new file mode 100644 index 0000000000..2a72bd8a85 --- /dev/null +++ b/tests/src/JIT/Regression/JitBlue/GitHub_10940/GitHub_10940.cs @@ -0,0 +1,58 @@ +// 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.Runtime.CompilerServices; + +// This test checks whether or not the JIT properly spills side effects in the importer when dumping multi-reg values +// to temps. If the JIT does not do so correctly, the calls to GetString() and GetDecimal() will be reordered and the +// test will fail with exit code 0; if it does do so correctly, the calls will not be reordered and the test will +// pass. + +class Test +{ + abstract class ValueSourceBase + { + public abstract string GetString(); + public abstract decimal GetDecimal(); + public abstract int GetReturnValue(); + } + + class ValueSource : ValueSourceBase + { + int rv; + + public override string GetString() + { + rv = 0; + return ""; + } + + public override decimal GetDecimal() + { + rv = 100; + return 0; + } + + public override int GetReturnValue() + { + return rv; + } + } + + Test(string s, decimal d) + { + } + + [MethodImpl(MethodImplOptions.NoInlining)] + static int M(ValueSourceBase vs) + { + new Test(vs.GetString(), vs.GetDecimal()); + return vs.GetReturnValue(); + } + + static int Main() + { + return M(new ValueSource()); + } +} diff --git a/tests/src/JIT/Regression/JitBlue/GitHub_10940/GitHub_10940.csproj b/tests/src/JIT/Regression/JitBlue/GitHub_10940/GitHub_10940.csproj new file mode 100644 index 0000000000..ef69a3b429 --- /dev/null +++ b/tests/src/JIT/Regression/JitBlue/GitHub_10940/GitHub_10940.csproj @@ -0,0 +1,42 @@ +<?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> + + <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></DebugType> + <Optimize>True</Optimize> + </PropertyGroup> + <ItemGroup> + <Compile Include="GitHub_10940.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> |