From 47bb5bcbb4f5b96e829523b59d9a66cc730fce14 Mon Sep 17 00:00:00 2001 From: Andy Ayers Date: Tue, 5 Sep 2017 07:23:55 -0700 Subject: JIT: allow inlines of methods with calli (#13756) Provided call sig has default callling convention. Added test case. Continuation of #12714. --- tests/src/JIT/opt/Inline/tests/calli.il | 51 +++++++++++++++++++++++++++++ tests/src/JIT/opt/Inline/tests/calli.ilproj | 34 +++++++++++++++++++ 2 files changed, 85 insertions(+) create mode 100644 tests/src/JIT/opt/Inline/tests/calli.il create mode 100644 tests/src/JIT/opt/Inline/tests/calli.ilproj (limited to 'tests') 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 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + ..\..\ + true + + + + + + + False + + + + PdbOnly + + + + + + + + + + \ No newline at end of file -- cgit v1.2.3