diff options
author | Jarret Shook <jashoo@microsoft.com> | 2019-07-18 21:07:08 -0700 |
---|---|---|
committer | 이형주/Common Platform Lab(SR)/Staff Engineer/삼성전자 <leee.lee@samsung.com> | 2019-08-08 12:47:29 +0900 |
commit | fa73c8747748a18a0a8a7ebbdf3d6ac6b81629c4 (patch) | |
tree | 437f226fd07e6cd0cdd5f35c5067bc52b219dc34 /tests | |
parent | 19bf6548c784fcc5cdf778a8f3a5a3458444dd3d (diff) | |
download | coreclr-fa73c8747748a18a0a8a7ebbdf3d6ac6b81629c4.tar.gz coreclr-fa73c8747748a18a0a8a7ebbdf3d6ac6b81629c4.tar.bz2 coreclr-fa73c8747748a18a0a8a7ebbdf3d6ac6b81629c4.zip |
Fail to explicitly tail call on x86 unix. (#25032)
* Fail to explicitly tail call on x86 unix.
* Correctly return 100
* Correct return value
* Add noway assert in morphTailCall to avoid morphing slow tail calls on unix.
* Address feedback
Diffstat (limited to 'tests')
-rw-r--r-- | tests/src/JIT/Regression/JitBlue/GitHub_25020/GitHub_25020.cs | 32 | ||||
-rw-r--r-- | tests/src/JIT/Regression/JitBlue/GitHub_25020/GitHub_25020.csproj | 17 |
2 files changed, 49 insertions, 0 deletions
diff --git a/tests/src/JIT/Regression/JitBlue/GitHub_25020/GitHub_25020.cs b/tests/src/JIT/Regression/JitBlue/GitHub_25020/GitHub_25020.cs new file mode 100644 index 0000000000..89d54315e8 --- /dev/null +++ b/tests/src/JIT/Regression/JitBlue/GitHub_25020/GitHub_25020.cs @@ -0,0 +1,32 @@ +// 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; +using System.Reflection; +using System.Reflection.Emit; + +namespace GitHub_25020 +{ + class Program + { + static int Main(string[] args) + { + DynamicMethod dm = new DynamicMethod("MyMethod", typeof(string), new Type[] { typeof(string), typeof(string) }); + + ILGenerator generator = dm.GetILGenerator(); + generator.Emit(OpCodes.Ldarg_0); + generator.Emit(OpCodes.Ldarg_1); + generator.Emit(OpCodes.Tailcall); + generator.EmitCall(OpCodes.Call, typeof(String).GetMethod("Concat", new Type[] { typeof(string), typeof(string) }), null); + generator.Emit(OpCodes.Ret); + + string a = "1234"; + string b = "abcd"; + + Console.WriteLine(dm.Invoke(null, BindingFlags.Default, null, new object[] {a, b}, null)); + + return 100; + } + } +}
\ No newline at end of file diff --git a/tests/src/JIT/Regression/JitBlue/GitHub_25020/GitHub_25020.csproj b/tests/src/JIT/Regression/JitBlue/GitHub_25020/GitHub_25020.csproj new file mode 100644 index 0000000000..c24f74b865 --- /dev/null +++ b/tests/src/JIT/Regression/JitBlue/GitHub_25020/GitHub_25020.csproj @@ -0,0 +1,17 @@ +<?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)' == '' ">Release</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <AssemblyName>$(MSBuildProjectName)</AssemblyName> + <OutputType>Exe</OutputType> + <DebugType></DebugType> + <Optimize>True</Optimize> + </PropertyGroup> + <ItemGroup> + <Compile Include="$(MSBuildProjectName).cs" /> + </ItemGroup> + <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" /> + <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup> +</Project> |