summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorsandreenko <seandree@microsoft.com>2016-11-03 13:58:25 -0700
committerGitHub <noreply@github.com>2016-11-03 13:58:25 -0700
commit552dae981e06efa059ac6e5d3bb326b54fc7eabe (patch)
tree5fd95426f20f90e1ef0a408d9adb12b84cfb73d4 /tests
parenta9b6991acf0cf6fd721d3ba8d8867dcb5c454918 (diff)
parentfb33095254c63e8bcb89dd4e15269de309c6ed5c (diff)
downloadcoreclr-552dae981e06efa059ac6e5d3bb326b54fc7eabe.tar.gz
coreclr-552dae981e06efa059ac6e5d3bb326b54fc7eabe.tar.bz2
coreclr-552dae981e06efa059ac6e5d3bb326b54fc7eabe.zip
Merge pull request #7908 from sandreenko/fix_tail_call_in_R2R
Correct pattern check for tail calls
Diffstat (limited to 'tests')
-rw-r--r--tests/src/JIT/Regression/JitBlue/GitHub_CoreRT_2073/GitHub_CoreRT_2073.il55
-rw-r--r--tests/src/JIT/Regression/JitBlue/GitHub_CoreRT_2073/GitHub_CoreRT_2073.ilproj38
2 files changed, 93 insertions, 0 deletions
diff --git a/tests/src/JIT/Regression/JitBlue/GitHub_CoreRT_2073/GitHub_CoreRT_2073.il b/tests/src/JIT/Regression/JitBlue/GitHub_CoreRT_2073/GitHub_CoreRT_2073.il
new file mode 100644
index 0000000000..28adbc49bb
--- /dev/null
+++ b/tests/src/JIT/Regression/JitBlue/GitHub_CoreRT_2073/GitHub_CoreRT_2073.il
@@ -0,0 +1,55 @@
+// 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.
+
+// Test for a issue when tail call with small return type
+// doesn't pass tail call pattern assert.
+// In addition there is "call->branch on return->return" tail call pattern check.
+
+
+.assembly extern mscorlib {}
+
+.assembly GitHub_CoreRT_2073.exe {}
+
+.class public Test
+{
+
+.method private hidebysig static bool tailAsgReturn(int32 deep) cil managed
+{
+ // Code size 24 (0x18)
+ .maxstack 20
+ IL_0000: ldarg.0
+ IL_0001: ldc.i4.s -100
+ IL_0003: bgt.s IL_0007
+ IL_0005: ldc.i4.1
+ IL_0006: ret
+ IL_0007: ldarg.0
+ IL_0008: ldc.i4.0
+ IL_0009: bgt.s IL_000f
+
+ IL_000a: ldarg.0
+ IL_000b: ldc.i4.1
+ IL_000c: sub
+ IL_000d: call bool Test::tailAsgReturn(int32)
+ IL_000e: br IL_0017
+ IL_000f: ldarg.0
+ IL_0010: ldc.i4.2
+ IL_0011: sub
+ IL_0012: call bool Test::tailAsgReturn(int32)
+ IL_0017: ret
+} // end of method Test::tailAsgReturn
+
+.method public hidebysig static int32 Main(string[] args) cil managed
+{
+ .entrypoint
+ // Code size 14 (0xe)
+ .maxstack 8
+ IL_0000: ldc.i4.s 100
+ IL_0002: call bool Test::tailAsgReturn(int32)
+ IL_0007: brtrue.s IL_000b
+ IL_0009: ldc.i4.m1
+ IL_000a: ret
+ IL_000b: ldc.i4.s 100
+ IL_000d: ret
+} // end of method Test::Main
+}
diff --git a/tests/src/JIT/Regression/JitBlue/GitHub_CoreRT_2073/GitHub_CoreRT_2073.ilproj b/tests/src/JIT/Regression/JitBlue/GitHub_CoreRT_2073/GitHub_CoreRT_2073.ilproj
new file mode 100644
index 0000000000..fe8a3d3947
--- /dev/null
+++ b/tests/src/JIT/Regression/JitBlue/GitHub_CoreRT_2073/GitHub_CoreRT_2073.ilproj
@@ -0,0 +1,38 @@
+<?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 .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>None</DebugType>
+ <Optimize>True</Optimize>
+ </PropertyGroup>
+ <ItemGroup>
+ <Compile Include="GitHub_CoreRT_2073.il" />
+ </ItemGroup>
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+ <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+ </PropertyGroup>
+</Project>