summaryrefslogtreecommitdiff
path: root/tests/src/JIT/opt
diff options
context:
space:
mode:
authorAndy Ayers <andya@microsoft.com>2017-09-05 07:23:55 -0700
committerGitHub <noreply@github.com>2017-09-05 07:23:55 -0700
commit47bb5bcbb4f5b96e829523b59d9a66cc730fce14 (patch)
tree4cb4ec0e78125e5b1175a65b467dccebc54e519b /tests/src/JIT/opt
parent34b3f892268460c223e4c2f300484d2fb9c10ed7 (diff)
downloadcoreclr-47bb5bcbb4f5b96e829523b59d9a66cc730fce14.tar.gz
coreclr-47bb5bcbb4f5b96e829523b59d9a66cc730fce14.tar.bz2
coreclr-47bb5bcbb4f5b96e829523b59d9a66cc730fce14.zip
JIT: allow inlines of methods with calli (#13756)
Provided call sig has default callling convention. Added test case. Continuation of #12714.
Diffstat (limited to 'tests/src/JIT/opt')
-rw-r--r--tests/src/JIT/opt/Inline/tests/calli.il51
-rw-r--r--tests/src/JIT/opt/Inline/tests/calli.ilproj34
2 files changed, 85 insertions, 0 deletions
diff --git a/tests/src/JIT/opt/Inline/tests/calli.il b/tests/src/JIT/opt/Inline/tests/calli.il
new file mode 100644
index 0000000000..101bc28810
--- /dev/null
+++ b/tests/src/JIT/opt/Inline/tests/calli.il
@@ -0,0 +1,51 @@
+// 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 that inliner can now inline g1 and g2
+
+.assembly extern legacy library mscorlib {}
+
+.assembly legacy library calli_inline {}
+.class private auto ansi beforefieldinit calli_test
+ extends [mscorlib]System.Object
+{
+ .field private static int32 a
+ .field private static int32 b
+ .method public static int32 f1()
+ {
+ ldsfld int32 calli_test::a
+ ret
+ }
+ .method public static int32 f2()
+ {
+ ldsfld int32 calli_test::b
+ ret
+ }
+ .method public static int32 g1()
+ {
+ ldftn int32 calli_test::f1()
+ calli int32 ()
+ ret
+ }
+ .method public static int32 g2()
+ {
+ ldftn int32 calli_test::f2()
+ calli int32 ()
+ ret
+ }
+ .method public hidebysig static int32 Main() cil managed
+ {
+ .entrypoint
+ .maxstack 2
+ call int32 calli_test::g1()
+ call int32 calli_test::g2()
+ beq.s GOOD
+ ldc.i4 0
+ br.s DONE
+ GOOD:
+ ldc.i4 100
+ DONE:
+ ret
+ }
+}
diff --git a/tests/src/JIT/opt/Inline/tests/calli.ilproj b/tests/src/JIT/opt/Inline/tests/calli.ilproj
new file mode 100644
index 0000000000..8a237a0cb5
--- /dev/null
+++ b/tests/src/JIT/opt/Inline/tests/calli.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>
+ <RestorePackages>true</RestorePackages>
+ </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="calli.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> \ No newline at end of file