Skip to content

Commit

Permalink
Import JIT tests.
Browse files Browse the repository at this point in the history
This brings over most of the tests from `JIT/Directed` that can
target CoreCLR.
  • Loading branch information
pgavlin committed May 19, 2015
1 parent 1099090 commit 31e98f2
Show file tree
Hide file tree
Showing 79 changed files with 8,937 additions and 0 deletions.
76 changes: 76 additions & 0 deletions tests/src/JIT/Directed/Arrays/complex2.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//

using System;
public struct Yak
{
public Int32 a;
private String _foo;
public Int32 b;
public void Do_Something()
{
_foo = a.ToString();
b += a;
}
}


internal class Complex2_Array_Test
{
public static void test(Yak[,,,,,,] Odd_Variable)
{
Console.Write(Odd_Variable.Length);
}
public static int Main(String[] args)
{
Console.WriteLine("Starting...");
int SIZE = 2;
Int64 sum = 0;

Yak[,,,,,,] foo = new Yak[SIZE, SIZE, SIZE, SIZE, SIZE, SIZE, SIZE];
int i, j, k, l, m, n, o;

for (i = 0; i < SIZE; i++)
for (j = 0; j < SIZE; j++)
for (k = 0; k < SIZE; k++)
for (l = 0; l < SIZE; l++)
for (m = 0; m < SIZE; m++)
for (n = 0; n < SIZE; n++)
for (o = 0; o < SIZE; o++)
{
foo[i, j, k, l, m, n, o].a = i * j * k * l * m * n * o;
foo[i, j, k, l, m, n, o].b = i + j + k + l + m + n + o;
foo[i, j, k, l, m, n, o].Do_Something();
}

for (i = 0; i < SIZE; i++)
for (j = 0; j < SIZE; j++)
for (k = 0; k < SIZE; k++)
for (l = 0; l < SIZE; l++)
for (m = 0; m < SIZE; m++)
for (n = 0; n < SIZE; n++)
for (o = 0; o < SIZE; o++)
{
sum += foo[i, j, k, l, m, n, o].b;
}

Console.WriteLine("\nTry to get count!");

test(foo);

if ((foo.Length == SIZE * SIZE * SIZE * SIZE * SIZE * SIZE * SIZE) && (sum == 449))
{
Console.Write("Count is:" + foo.Length.ToString());
Console.WriteLine("\nEverything Worked!");
return 100;
}
else
{
Console.WriteLine("Count is:" + foo.Length.ToString());
Console.WriteLine("Sum is:" + sum.ToString());
Console.WriteLine("\nEverything Didnt Work!");
return 1;
}
}
}
47 changes: 47 additions & 0 deletions tests/src/JIT/Directed/Arrays/simple2.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//

using System;

internal class Simple2_Array_Test
{
public static int Main(String[] args)
{
Console.WriteLine("Starting...");
int SIZE = 10;

Int32[,,,] foo = new Int32[SIZE, SIZE, SIZE, SIZE];
int i, j, k, l, m;
Int64 sum = 0;


for (i = 0; i < SIZE; i++)
for (j = 0; j < SIZE; j++)
for (k = 0; k < SIZE; k++)
for (l = 0; l < SIZE; l++)
{
foo[i, j, k, l] = i * j * k * l;
}

for (i = 0; i < SIZE; i++)
for (j = 0; j < i; j++)
for (k = 0; k < j; k++)
for (l = 0; l < k; l++)
for (m = 0; m < l; m++)
{
sum += foo[i, j, k, l];
}

if (sum == 197163)
{
Console.WriteLine("Everything Worked!");
return 100;
}
else
{
Console.WriteLine("Something is broken!");
return 1;
}
}
}
19 changes: 19 additions & 0 deletions tests/src/JIT/Directed/StrAccess/StrAccess.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?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" />
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
</PropertyGroup>
<Target Name="Build">
<ItemGroup>
<AllSourceFiles Include="$(MSBuildProjectDirectory)\*.cs" />
</ItemGroup>
<PropertyGroup>
<GenerateRunScript>false</GenerateRunScript>
</PropertyGroup>
<MSBuild Projects="cs_template.proj" Properties="AssemblyName1=%(AllSourceFiles.FileName);AllowUnsafeBlocks=True;IntermediateOutputPath=$(IntermediateOutputPath)\%(AllSourceFiles.FileName)\" />
</Target>
</Project>
27 changes: 27 additions & 0 deletions tests/src/JIT/Directed/StrAccess/app.config
Original file line number Diff line number Diff line change
@@ -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>
42 changes: 42 additions & 0 deletions tests/src/JIT/Directed/StrAccess/cs_template.proj
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?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>$(AssemblyName1)</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>
<ItemGroup>
<Compile Include="$(AssemblyName1).cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<None Include="app.config" />
</ItemGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
</PropertyGroup>
</Project>
6 changes: 6 additions & 0 deletions tests/src/JIT/Directed/StrAccess/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="System.Console" version="4.0.0-beta-22405" />
<package id="System.Runtime" version="4.0.20-beta-22405" />
<package id="System.Runtime.Extensions" version="4.0.10-beta-22412" />
</packages>
Loading

0 comments on commit 31e98f2

Please sign in to comment.