summaryrefslogtreecommitdiff
path: root/tests/src/JIT/Directed
diff options
context:
space:
mode:
authorPat Gavlin <pagavlin@microsoft.com>2015-12-07 12:07:12 -0800
committerPat Gavlin <pagavlin@microsoft.com>2015-12-08 12:22:58 -0800
commitd070ca1f4e643c1cb9dc7d750f2476f2aa77efc3 (patch)
tree71ee6b489d8198d943236ae635db07dc0426b7ed /tests/src/JIT/Directed
parent49f5b95ee35535189229525947cdb9af245bb4f9 (diff)
downloadcoreclr-d070ca1f4e643c1cb9dc7d750f2476f2aa77efc3.tar.gz
coreclr-d070ca1f4e643c1cb9dc7d750f2476f2aa77efc3.tar.bz2
coreclr-d070ca1f4e643c1cb9dc7d750f2476f2aa77efc3.zip
Import additional JIT tests.
Most of these tests were missed in the first round because they rely on TypedReference.
Diffstat (limited to 'tests/src/JIT/Directed')
-rw-r--r--tests/src/JIT/Directed/UnrollLoop/loop6.cs194
-rw-r--r--tests/src/JIT/Directed/UnrollLoop/loop6_cs_d.csproj50
-rw-r--r--tests/src/JIT/Directed/UnrollLoop/loop6_cs_do.csproj50
-rw-r--r--tests/src/JIT/Directed/UnrollLoop/loop6_cs_r.csproj50
-rw-r--r--tests/src/JIT/Directed/UnrollLoop/loop6_cs_ro.csproj50
5 files changed, 394 insertions, 0 deletions
diff --git a/tests/src/JIT/Directed/UnrollLoop/loop6.cs b/tests/src/JIT/Directed/UnrollLoop/loop6.cs
new file mode 100644
index 0000000000..f4c2abfe2b
--- /dev/null
+++ b/tests/src/JIT/Directed/UnrollLoop/loop6.cs
@@ -0,0 +1,194 @@
+// 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 struct VT
+{
+ public float one;
+ public double delta;
+ public double temp;
+}
+internal class loop6
+{
+ public static int cnt;
+
+ public static float sone;
+ public static double sdelta;
+ public static double stemp;
+
+ public static void f1()
+ {
+ float one = 1.0F;
+ double delta = 1.0D;
+ double temp = 0.0D;
+ while (temp != one)
+ {
+ temp = one + delta;
+ delta = delta / 2.0F;
+ }
+ if ((delta - 5.551115E-17) < 1.2E-10)
+ {
+ cnt++;
+ System.Console.WriteLine("f1 passed");
+ }
+ else
+ System.Console.WriteLine("f1 failed");
+ }
+
+ public static void f2()
+ {
+ float one = 1.0F;
+ double delta = 1.0D;
+ double temp = 0.0D;
+ while (temp != one)
+ {
+ temp = one + delta;
+ delta = delta / 2.0F;
+ }
+ if ((delta - 5.551115E-17) < 1.2E-10)
+ {
+ cnt++;
+ System.Console.WriteLine("f2 passed");
+ }
+ else
+ System.Console.WriteLine("f2 failed");
+ }
+
+ public static void f3()
+ {
+ double temp = 0.0D;
+ float one = 1.0F;
+ double delta = 1.0D;
+ while (temp != one)
+ {
+ temp = one + delta;
+ delta = delta / 2.0F;
+ }
+ if ((delta - 5.551115E-17) < 1.2E-10)
+ {
+ cnt++;
+ System.Console.WriteLine("f3 passed");
+ }
+ else
+ System.Console.WriteLine("f3 failed");
+ }
+
+ public static void f4()
+ {
+ float one = 1.0F;
+ double delta = 1.0D;
+ double temp = 0.0D;
+ temp = one + delta;
+ while (temp > one)
+ {
+ temp = one + delta;
+ delta = delta / 2.0F;
+ }
+ if ((delta - 5.551115E-17) < 1.2E-10)
+ {
+ cnt++;
+ System.Console.WriteLine("f4 passed");
+ }
+ else
+ System.Console.WriteLine("f4 failed");
+ }
+
+ public static void f5()
+ {
+ sone = 1.0F;
+ sdelta = 1.0D;
+ stemp = 0.0D;
+ while (stemp != sone)
+ {
+ stemp = sone + sdelta;
+ sdelta = sdelta / 2.0F;
+ }
+ if ((sdelta - 5.551115E-17) < 1.2E-10)
+ {
+ cnt++;
+ System.Console.WriteLine("f5 passed");
+ }
+ else
+ System.Console.WriteLine("f5 failed");
+ }
+ public static void f6()
+ {
+ VT vt;
+ vt.one = 1.0F;
+ vt.delta = 1.0D;
+ vt.temp = 0.0D;
+ while (vt.temp != vt.one)
+ {
+ vt.temp = vt.one + vt.delta;
+ vt.delta = vt.delta / 2.0F;
+ }
+ if ((vt.delta - 5.551115E-17) < 1.2E-10)
+ {
+ cnt++;
+ System.Console.WriteLine("f6 passed");
+ }
+ else
+ System.Console.WriteLine("f6 failed");
+ }
+
+ public static void f7()
+ {
+ float one = 1.0F;
+ double delta = 1.0D;
+ double temp = 0.0D;
+ temp = one + delta;
+ while (-temp < -one)
+ {
+ temp = one + delta;
+ delta = delta * 0.5F;
+ }
+ if ((delta - 5.551115E-17) < 1.2E-10)
+ {
+ cnt++;
+ System.Console.WriteLine("f7 passed");
+ }
+ else
+ System.Console.WriteLine("f7 failed");
+ }
+
+ public static void f8()
+ {
+ float one = 1.0F;
+ double delta = 1.0D;
+ double temp = 0.0D;
+
+ TypedReference one_ref = __makeref(one);
+ TypedReference delta_ref = __makeref(delta);
+ TypedReference temp_ref = __makeref(temp);
+
+ while (__refvalue(temp_ref, double) != __refvalue(one_ref, float))
+ {
+ __refvalue(temp_ref, double) = __refvalue(one_ref, float) + __refvalue(delta_ref, double);
+ __refvalue(delta_ref, double) = __refvalue(delta_ref, double) / 2.0F;
+ }
+ if ((__refvalue(delta_ref, double) - 5.551115E-17) < 1.2E-10)
+ {
+ cnt++;
+ System.Console.WriteLine("f8 passed");
+ }
+ else
+ System.Console.WriteLine("f8 failed");
+ }
+
+ public static int Main()
+ {
+ cnt = 0;
+ f1();
+ f2();
+ f3();
+ f4();
+ f5();
+ f6();
+ f7();
+ f8();
+ if (cnt == 8)
+ return 100;
+ else
+ return 1;
+ }
+}
diff --git a/tests/src/JIT/Directed/UnrollLoop/loop6_cs_d.csproj b/tests/src/JIT/Directed/UnrollLoop/loop6_cs_d.csproj
new file mode 100644
index 0000000000..5e18a8d558
--- /dev/null
+++ b/tests/src/JIT/Directed/UnrollLoop/loop6_cs_d.csproj
@@ -0,0 +1,50 @@
+<?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>
+ <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+ <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
+ </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>
+ <DebugType></DebugType>
+ <Optimize></Optimize>
+ </PropertyGroup>
+ <ItemGroup>
+ <Compile Include="loop6.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
+ <None Include="app.config" />
+ </ItemGroup>
+ <ItemGroup>
+ <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+ </ItemGroup>
+ <PropertyGroup>
+ <ProjectJson>$(JitPackagesConfigFileDirectory)empty\project.json</ProjectJson>
+ <ProjectLockJson>$(JitPackagesConfigFileDirectory)empty\project.lock.json</ProjectLockJson>
+ </PropertyGroup>
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+ <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+ </PropertyGroup>
+</Project>
diff --git a/tests/src/JIT/Directed/UnrollLoop/loop6_cs_do.csproj b/tests/src/JIT/Directed/UnrollLoop/loop6_cs_do.csproj
new file mode 100644
index 0000000000..786f203423
--- /dev/null
+++ b/tests/src/JIT/Directed/UnrollLoop/loop6_cs_do.csproj
@@ -0,0 +1,50 @@
+<?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>
+ <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+ <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
+ </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>
+ <DebugType></DebugType>
+ <Optimize>True</Optimize>
+ </PropertyGroup>
+ <ItemGroup>
+ <Compile Include="loop6.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
+ <None Include="app.config" />
+ </ItemGroup>
+ <ItemGroup>
+ <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+ </ItemGroup>
+ <PropertyGroup>
+ <ProjectJson>$(JitPackagesConfigFileDirectory)empty\project.json</ProjectJson>
+ <ProjectLockJson>$(JitPackagesConfigFileDirectory)empty\project.lock.json</ProjectLockJson>
+ </PropertyGroup>
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+ <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+ </PropertyGroup>
+</Project>
diff --git a/tests/src/JIT/Directed/UnrollLoop/loop6_cs_r.csproj b/tests/src/JIT/Directed/UnrollLoop/loop6_cs_r.csproj
new file mode 100644
index 0000000000..5e18a8d558
--- /dev/null
+++ b/tests/src/JIT/Directed/UnrollLoop/loop6_cs_r.csproj
@@ -0,0 +1,50 @@
+<?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>
+ <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+ <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
+ </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>
+ <DebugType></DebugType>
+ <Optimize></Optimize>
+ </PropertyGroup>
+ <ItemGroup>
+ <Compile Include="loop6.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
+ <None Include="app.config" />
+ </ItemGroup>
+ <ItemGroup>
+ <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+ </ItemGroup>
+ <PropertyGroup>
+ <ProjectJson>$(JitPackagesConfigFileDirectory)empty\project.json</ProjectJson>
+ <ProjectLockJson>$(JitPackagesConfigFileDirectory)empty\project.lock.json</ProjectLockJson>
+ </PropertyGroup>
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+ <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+ </PropertyGroup>
+</Project>
diff --git a/tests/src/JIT/Directed/UnrollLoop/loop6_cs_ro.csproj b/tests/src/JIT/Directed/UnrollLoop/loop6_cs_ro.csproj
new file mode 100644
index 0000000000..786f203423
--- /dev/null
+++ b/tests/src/JIT/Directed/UnrollLoop/loop6_cs_ro.csproj
@@ -0,0 +1,50 @@
+<?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>
+ <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+ <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
+ </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>
+ <DebugType></DebugType>
+ <Optimize>True</Optimize>
+ </PropertyGroup>
+ <ItemGroup>
+ <Compile Include="loop6.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="$(JitPackagesConfigFileDirectory)empty\project.json" />
+ <None Include="app.config" />
+ </ItemGroup>
+ <ItemGroup>
+ <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+ </ItemGroup>
+ <PropertyGroup>
+ <ProjectJson>$(JitPackagesConfigFileDirectory)empty\project.json</ProjectJson>
+ <ProjectLockJson>$(JitPackagesConfigFileDirectory)empty\project.lock.json</ProjectLockJson>
+ </PropertyGroup>
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+ <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+ </PropertyGroup>
+</Project>