diff options
author | Richard L Ford <richford@microsoft.com> | 2016-02-16 15:13:32 -0800 |
---|---|---|
committer | Richard L Ford <richford@microsoft.com> | 2016-02-17 20:09:37 -0800 |
commit | 30c68b9d32ee6a6b82fa8315087a6dcbbe85a4b2 (patch) | |
tree | e3bff4112025ef94efd4ad1e108f863defc7e873 /tests/src/JIT/Methodical/localloc | |
parent | 89396ee16657a2884babe8ac5d0e688743d4cd83 (diff) | |
download | coreclr-30c68b9d32ee6a6b82fa8315087a6dcbbe85a4b2.tar.gz coreclr-30c68b9d32ee6a6b82fa8315087a6dcbbe85a4b2.tar.bz2 coreclr-30c68b9d32ee6a6b82fa8315087a6dcbbe85a4b2.zip |
Port desktop tests that had references
This change ports desktop tests that had references to dlls.
It also fixes some of the dll project files.
In addition there are some additional tests that were not
previously ported (but that do not reference dlls).
There are 4 tests that are excluded because of issue #3216.
Diffstat (limited to 'tests/src/JIT/Methodical/localloc')
-rw-r--r-- | tests/src/JIT/Methodical/localloc/call/app.config | 27 | ||||
-rw-r--r-- | tests/src/JIT/Methodical/localloc/call/call01.cs | 92 | ||||
-rw-r--r-- | tests/src/JIT/Methodical/localloc/call/call01_small.csproj | 54 |
3 files changed, 173 insertions, 0 deletions
diff --git a/tests/src/JIT/Methodical/localloc/call/app.config b/tests/src/JIT/Methodical/localloc/call/app.config new file mode 100644 index 0000000000..6f7bbd9d2b --- /dev/null +++ b/tests/src/JIT/Methodical/localloc/call/app.config @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="utf-8"?> +<configuration> + <runtime> + <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> + <dependentAssembly> + <assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.20.0" newVersion="4.0.20.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Text.Encoding" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.IO" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Reflection" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" /> + </dependentAssembly> + </assemblyBinding> + </runtime> +</configuration> diff --git a/tests/src/JIT/Methodical/localloc/call/call01.cs b/tests/src/JIT/Methodical/localloc/call/call01.cs new file mode 100644 index 0000000000..572ccef2d4 --- /dev/null +++ b/tests/src/JIT/Methodical/localloc/call/call01.cs @@ -0,0 +1,92 @@ +// 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 reading localloc variable with function call. + */ + +using System; +using LocallocTesting; + +internal class LocallocTest +{ + private static int s_locallocSize = 0; + + public static unsafe int Main() + { + ulong local1 = Global.INITIAL_VALUE; + ulong local2 = local1 + 1; +#if LOCALLOC_SMALL + Int32* intArray1 = stackalloc Int32[1]; + Int32* intArray2 = stackalloc Int32[1]; + s_locallocSize = 1; +#elif LOCALLOC_LARGE + Int32* intArray1 = stackalloc Int32[0x1000]; + Int32* intArray2 = stackalloc Int32[0x1000]; + locallocSize = 0x1000; +#else + Int32* intArray1 = stackalloc Int32[Global.stackAllocSize]; + Int32* intArray2 = stackalloc Int32[Global.stackAllocSize]; + locallocSize = Global.stackAllocSize; +#endif + Global.initializeStack(intArray1, s_locallocSize, 1000); + Global.initializeStack(intArray2, s_locallocSize, 2000); + + if (!func1(1, 2, 3, 4, 5, 6, 7, 8, intArray1, intArray2)) + return 1; + + if (!Global.verifyStack("intArray1", intArray1, s_locallocSize, 1000)) + { + return 1; + } + if (!Global.verifyStack("intArray2", intArray2, s_locallocSize, 2000)) + { + return 1; + } + if (!Global.verifyLocal("local1", local1, Global.INITIAL_VALUE)) + { + return 1; + } + if (!Global.verifyLocal("local2", local2, Global.INITIAL_VALUE + 1)) + { + return 1; + } + Console.WriteLine("Passed\n"); + return 100; + } + + private static unsafe bool func1(int i1, int i2, int i3, int i4, int i5, int i6, int i7, int i8, Int32* ar1, Int32* ar2) + { +#if LOCALLOC_SMALL + Int32* intArray1 = stackalloc Int32[1]; + Int32* intArray2 = stackalloc Int32[1]; +#elif LOCALLOC_LARGE + Int32* intArray1 = stackalloc Int32[0x1000]; + Int32* intArray2 = stackalloc Int32[0x1000]; +#else + Int32* intArray1 = stackalloc Int32[Global.stackAllocSize]; + Int32* intArray2 = stackalloc Int32[Global.stackAllocSize]; +#endif + Global.initializeStack(intArray1, s_locallocSize, 3000); + Global.initializeStack(intArray2, s_locallocSize, 4000); + + if (!Global.verifyStack("ar1", ar1, s_locallocSize, 1000)) + { + return false; + } + if (!Global.verifyStack("ar2", ar2, s_locallocSize, 2000)) + { + return false; + } + if (!Global.verifyStack("intArray1", intArray1, s_locallocSize, 3000)) + { + return false; + } + if (!Global.verifyStack("intArray2", intArray2, s_locallocSize, 4000)) + { + return false; + } + return true; + } +} diff --git a/tests/src/JIT/Methodical/localloc/call/call01_small.csproj b/tests/src/JIT/Methodical/localloc/call/call01_small.csproj new file mode 100644 index 0000000000..c8a8a7e498 --- /dev/null +++ b/tests/src/JIT/Methodical/localloc/call/call01_small.csproj @@ -0,0 +1,54 @@ +<?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\11.0\UITestExtensionPackages</ReferencePath> + <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir> + <RestorePackages>true</RestorePackages> + <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> + <!-- Set to 'Full' if the Debug? column is marked in the spreadsheet. Leave blank otherwise. --> + <DebugType>PdbOnly</DebugType> + <NoLogo>True</NoLogo> + <AllowUnsafeBlocks>True</AllowUnsafeBlocks> + <DefineConstants>$(DefineConstants);DESKTOP;LOCALLOC_SMALL</DefineConstants> + </PropertyGroup> + <ItemGroup> + <Compile Include="call01.cs" /> + <ProjectReference Include="..\..\..\jit64\localloc\common\common.ilproj" /> + </ItemGroup> + <ItemGroup> + <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" /> + <None Include="app.config" /> + </ItemGroup> + <ItemGroup> + <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" /> + </ItemGroup> + <PropertyGroup> + <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson> + <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson> + </PropertyGroup> + <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" /> + <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "> + </PropertyGroup> +</Project> |