diff options
author | Rama Krishnan Raghupathy <ramarag@microsoft.com> | 2016-04-21 19:51:49 -0700 |
---|---|---|
committer | Rama Krishnan Raghupathy <ramarag@microsoft.com> | 2016-05-02 17:46:44 -0700 |
commit | ea83434a4f3a92f3d476291031300b9de9c3528b (patch) | |
tree | de8e0503796de44a881d8171ad502f24f96059d7 /tests/src/CoreMangLib | |
parent | ede2e6e2677ea633311d9041516e16a0ee6fc33c (diff) | |
download | coreclr-ea83434a4f3a92f3d476291031300b9de9c3528b.tar.gz coreclr-ea83434a4f3a92f3d476291031300b9de9c3528b.tar.bz2 coreclr-ea83434a4f3a92f3d476291031300b9de9c3528b.zip |
Arm64:Implemeting ThisPtrRetBufPrecode:
Precode to shuffle this and retbuf for closed delegates over static methods with return buffer
Diffstat (limited to 'tests/src/CoreMangLib')
-rw-r--r-- | tests/src/CoreMangLib/system/delegate/miscellaneous/ClosedStatic.cs | 41 | ||||
-rw-r--r-- | tests/src/CoreMangLib/system/delegate/miscellaneous/ClosedStatic.csproj | 47 |
2 files changed, 88 insertions, 0 deletions
diff --git a/tests/src/CoreMangLib/system/delegate/miscellaneous/ClosedStatic.cs b/tests/src/CoreMangLib/system/delegate/miscellaneous/ClosedStatic.cs new file mode 100644 index 0000000000..6b35433adb --- /dev/null +++ b/tests/src/CoreMangLib/system/delegate/miscellaneous/ClosedStatic.cs @@ -0,0 +1,41 @@ +// 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; + +class Program +{ + public int scale; + + public Program(int scale) + { + this.scale = scale; + } + public static decimal getfunc(Program prog,int constituent) + { + return new decimal(constituent/prog.scale); + } + static int Main(string[] args) + { + int result = -1; + + int constituent = 3; + Program prog = new Program(1); + 2.Equals(3); + + MethodInfo info = typeof(Program).GetMethod("getfunc", BindingFlags.Static | BindingFlags.Public); + + //Tests closed delegates over static methods with return buffer + Func<int, decimal> deepThought = (Func<int, decimal>)info.CreateDelegate(typeof(Func<int, decimal>), prog); + + var res1 = deepThought(constituent); + var res2 = deepThought(constituent); + + if (decimal.Compare(res1, res2) == 0) + return 100; + + return result; + + } +} diff --git a/tests/src/CoreMangLib/system/delegate/miscellaneous/ClosedStatic.csproj b/tests/src/CoreMangLib/system/delegate/miscellaneous/ClosedStatic.csproj new file mode 100644 index 0000000000..59b1c83c7d --- /dev/null +++ b/tests/src/CoreMangLib/system/delegate/miscellaneous/ClosedStatic.csproj @@ -0,0 +1,47 @@ +<?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> + <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> + <AllowUnsafeBlocks>true</AllowUnsafeBlocks> + <ReferenceLocalMscorlib>false</ReferenceLocalMscorlib> + <CLRTestKind>BuildAndRun</CLRTestKind> + </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> + <ItemGroup> + <!-- Add Compile Object Here --> + <Compile Include="ClosedStatic.cs" /> + </ItemGroup> + <ItemGroup> + <None Include="app.config" /> + <None Include="project.json" /> + </ItemGroup> + <ItemGroup> + <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" /> + </ItemGroup> + <ItemGroup> + <WarningLevel Include="1" /> + </ItemGroup> + <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" /> + <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "> + </PropertyGroup> +</Project> |