summaryrefslogtreecommitdiff
path: root/tests/src/JIT/Intrinsics
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src/JIT/Intrinsics')
-rw-r--r--tests/src/JIT/Intrinsics/MathCeilingDouble.cs172
-rw-r--r--tests/src/JIT/Intrinsics/MathCeilingDouble_r.csproj34
-rw-r--r--tests/src/JIT/Intrinsics/MathCeilingDouble_ro.csproj34
-rw-r--r--tests/src/JIT/Intrinsics/MathCeilingSingle.cs172
-rw-r--r--tests/src/JIT/Intrinsics/MathCeilingSingle_r.csproj34
-rw-r--r--tests/src/JIT/Intrinsics/MathCeilingSingle_ro.csproj34
-rw-r--r--tests/src/JIT/Intrinsics/MathFloorDouble.cs172
-rw-r--r--tests/src/JIT/Intrinsics/MathFloorDouble_r.csproj34
-rw-r--r--tests/src/JIT/Intrinsics/MathFloorDouble_ro.csproj34
-rw-r--r--tests/src/JIT/Intrinsics/MathFloorSingle.cs172
-rw-r--r--tests/src/JIT/Intrinsics/MathFloorSingle_r.csproj34
-rw-r--r--tests/src/JIT/Intrinsics/MathFloorSingle_ro.csproj34
-rw-r--r--tests/src/JIT/Intrinsics/MathRoundDouble.cs172
-rw-r--r--tests/src/JIT/Intrinsics/MathRoundDouble_r.csproj34
-rw-r--r--tests/src/JIT/Intrinsics/MathRoundDouble_ro.csproj34
-rw-r--r--tests/src/JIT/Intrinsics/MathRoundSingle.cs172
-rw-r--r--tests/src/JIT/Intrinsics/MathRoundSingle_r.csproj34
-rw-r--r--tests/src/JIT/Intrinsics/MathRoundSingle_ro.csproj34
18 files changed, 1440 insertions, 0 deletions
diff --git a/tests/src/JIT/Intrinsics/MathCeilingDouble.cs b/tests/src/JIT/Intrinsics/MathCeilingDouble.cs
new file mode 100644
index 0000000000..9893e994e7
--- /dev/null
+++ b/tests/src/JIT/Intrinsics/MathCeilingDouble.cs
@@ -0,0 +1,172 @@
+// 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;
+
+namespace MathCeilingDoubleTest
+{
+ class Program
+ {
+ public const int Pass = 100;
+ public const int Fail = 0;
+
+ public const double constantValue = 0.0;
+
+ public static double staticValue = 1.1;
+
+ public static double[] staticValueArray = new double[]
+ {
+ 2.2,
+ 3.3,
+ 4.4
+ };
+
+ public double instanceValue = 5.5;
+
+ public double[] instanceValueArray = new double[]
+ {
+ 6.6,
+ 7.7,
+ 8.8
+ };
+
+ unsafe static int Main(string[] args)
+ {
+ double localValue = 9.9;
+
+ var program = new Program();
+
+ if (Math.Round(constantValue) != 0.0)
+ {
+ Console.WriteLine("Math.Round of a constant value failed");
+ return Fail;
+ }
+
+ if (Math.Round(staticValue) != 1.0)
+ {
+ Console.WriteLine("Math.Round of a static value failed");
+ return Fail;
+ }
+
+ fixed (double* pStaticValue = &staticValue)
+ {
+ if (Math.Round(*pStaticValue) != 1.0)
+ {
+ Console.WriteLine("Math.Round of an addressed static value failed");
+ return Fail;
+ }
+ }
+
+ if (Math.Round(staticValueArray[0]) != 2.0)
+ {
+ Console.WriteLine("Math.Round of a static value array (index 0) failed");
+ return Fail;
+ }
+
+ if (Math.Round(staticValueArray[1]) != 3.0)
+ {
+ Console.WriteLine("Math.Round of a static value array (index 1) failed");
+ return Fail;
+ }
+
+ if (Math.Round(staticValueArray[2]) != 4.0)
+ {
+ Console.WriteLine("Math.Round of a static value array (index 2) failed");
+ return Fail;
+ }
+
+ fixed (double* pStaticValueArray = &staticValueArray[0])
+ {
+ if (Math.Round(pStaticValueArray[0]) != 2.0)
+ {
+ Console.WriteLine("Math.Round of a addressed static value array (index 0) failed");
+ return Fail;
+ }
+
+ if (Math.Round(pStaticValueArray[1]) != 3.0)
+ {
+ Console.WriteLine("Math.Round of a addressed static value array (index 1) failed");
+ return Fail;
+ }
+
+ if (Math.Round(pStaticValueArray[2]) != 4.0)
+ {
+ Console.WriteLine("Math.Round of a addressed static value array (index 2) failed");
+ return Fail;
+ }
+ }
+
+ if (Math.Round(program.instanceValue) != 6.0)
+ {
+ Console.WriteLine("Math.Round of an instance value failed");
+ return Fail;
+ }
+
+ fixed (double* pInstanceValue = &program.instanceValue)
+ {
+ if (Math.Round(*pInstanceValue) != 6.0)
+ {
+ Console.WriteLine("Math.Round of an addressed instance value failed");
+ return Fail;
+ }
+ }
+
+ if (Math.Round(program.instanceValueArray[0]) != 7.0)
+ {
+ Console.WriteLine("Math.Round of an instance value array (index 0) failed");
+ return Fail;
+ }
+
+ if (Math.Round(program.instanceValueArray[1]) != 8.0)
+ {
+ Console.WriteLine("Math.Round of an instance value array (index 1) failed");
+ return Fail;
+ }
+
+ if (Math.Round(program.instanceValueArray[2]) != 9.0)
+ {
+ Console.WriteLine("Math.Round of an instance value array (index 2) failed");
+ return Fail;
+ }
+
+ fixed (double* pInstanceValueArray = &program.instanceValueArray[0])
+ {
+ if (Math.Round(pInstanceValueArray[0]) != 7.0)
+ {
+ Console.WriteLine("Math.Round of a addressed instance value array (index 0) failed");
+ return Fail;
+ }
+
+ if (Math.Round(pInstanceValueArray[1]) != 8.0)
+ {
+ Console.WriteLine("Math.Round of a addressed instance value array (index 1) failed");
+ return Fail;
+ }
+
+ if (Math.Round(pInstanceValueArray[2]) != 9.0)
+ {
+ Console.WriteLine("Math.Round of a addressed instance value array (index 2) failed");
+ return Fail;
+ }
+ }
+
+ if (Math.Round(localValue) != 10.0)
+ {
+ Console.WriteLine("Math.Round of a local value failed");
+ return Fail;
+ }
+
+ double* pLocalValue = &localValue;
+
+ if (Math.Round(*pLocalValue) != 10.0)
+ {
+ Console.WriteLine("Math.Round of an addressed local value failed");
+ return Fail;
+ }
+
+ return Pass;
+ }
+ }
+}
diff --git a/tests/src/JIT/Intrinsics/MathCeilingDouble_r.csproj b/tests/src/JIT/Intrinsics/MathCeilingDouble_r.csproj
new file mode 100644
index 0000000000..ca3df051f6
--- /dev/null
+++ b/tests/src/JIT/Intrinsics/MathCeilingDouble_r.csproj
@@ -0,0 +1,34 @@
+<?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>
+ <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+ </PropertyGroup>
+ <!-- Default configurations to help VS understand the configurations -->
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
+ <ItemGroup>
+ <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+ <Visible>False</Visible>
+ </CodeAnalysisDependentAssemblyPaths>
+ </ItemGroup>
+ <PropertyGroup>
+ <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+ <DebugType>None</DebugType>
+ <Optimize></Optimize>
+ </PropertyGroup>
+ <ItemGroup>
+ <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="MathCeilingDouble.cs" />
+ </ItemGroup>
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+ <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+</Project>
diff --git a/tests/src/JIT/Intrinsics/MathCeilingDouble_ro.csproj b/tests/src/JIT/Intrinsics/MathCeilingDouble_ro.csproj
new file mode 100644
index 0000000000..0b912dc217
--- /dev/null
+++ b/tests/src/JIT/Intrinsics/MathCeilingDouble_ro.csproj
@@ -0,0 +1,34 @@
+<?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>
+ <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+ </PropertyGroup>
+ <!-- Default configurations to help VS understand the configurations -->
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
+ <ItemGroup>
+ <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+ <Visible>False</Visible>
+ </CodeAnalysisDependentAssemblyPaths>
+ </ItemGroup>
+ <PropertyGroup>
+ <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+ <DebugType>None</DebugType>
+ <Optimize>True</Optimize>
+ </PropertyGroup>
+ <ItemGroup>
+ <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="MathCeilingDouble.cs" />
+ </ItemGroup>
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+ <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+</Project>
diff --git a/tests/src/JIT/Intrinsics/MathCeilingSingle.cs b/tests/src/JIT/Intrinsics/MathCeilingSingle.cs
new file mode 100644
index 0000000000..b1db0c01d9
--- /dev/null
+++ b/tests/src/JIT/Intrinsics/MathCeilingSingle.cs
@@ -0,0 +1,172 @@
+// 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;
+
+namespace MathCeilingSingleTest
+{
+ class Program
+ {
+ public const int Pass = 100;
+ public const int Fail = 0;
+
+ public const float constantValue = 0.0f;
+
+ public static float staticValue = 1.1f;
+
+ public static float[] staticValueArray = new float[]
+ {
+ 2.2f,
+ 3.3f,
+ 4.4f
+ };
+
+ public float instanceValue = 5.5f;
+
+ public float[] instanceValueArray = new float[]
+ {
+ 6.6f,
+ 7.7f,
+ 8.8f
+ };
+
+ unsafe static int Main(string[] args)
+ {
+ float localValue = 9.9f;
+
+ var program = new Program();
+
+ if (MathF.Round(constantValue) != 0.0f)
+ {
+ Console.WriteLine("MathF.Round of a constant value failed");
+ return Fail;
+ }
+
+ if (MathF.Round(staticValue) != 1.0f)
+ {
+ Console.WriteLine("MathF.Round of a static value failed");
+ return Fail;
+ }
+
+ fixed (float* pStaticValue = &staticValue)
+ {
+ if (MathF.Round(*pStaticValue) != 1.0f)
+ {
+ Console.WriteLine("MathF.Round of an addressed static value failed");
+ return Fail;
+ }
+ }
+
+ if (MathF.Round(staticValueArray[0]) != 2.0f)
+ {
+ Console.WriteLine("MathF.Round of a static value array (index 0) failed");
+ return Fail;
+ }
+
+ if (MathF.Round(staticValueArray[1]) != 3.0f)
+ {
+ Console.WriteLine("MathF.Round of a static value array (index 1) failed");
+ return Fail;
+ }
+
+ if (MathF.Round(staticValueArray[2]) != 4.0f)
+ {
+ Console.WriteLine("MathF.Round of a static value array (index 2) failed");
+ return Fail;
+ }
+
+ fixed (float* pStaticValueArray = &staticValueArray[0])
+ {
+ if (MathF.Round(pStaticValueArray[0]) != 2.0f)
+ {
+ Console.WriteLine("MathF.Round of a addressed static value array (index 0) failed");
+ return Fail;
+ }
+
+ if (MathF.Round(pStaticValueArray[1]) != 3.0f)
+ {
+ Console.WriteLine("MathF.Round of a addressed static value array (index 1) failed");
+ return Fail;
+ }
+
+ if (MathF.Round(pStaticValueArray[2]) != 4.0f)
+ {
+ Console.WriteLine("MathF.Round of a addressed static value array (index 2) failed");
+ return Fail;
+ }
+ }
+
+ if (MathF.Round(program.instanceValue) != 6.0f)
+ {
+ Console.WriteLine("MathF.Round of an instance value failed");
+ return Fail;
+ }
+
+ fixed (float* pInstanceValue = &program.instanceValue)
+ {
+ if (MathF.Round(*pInstanceValue) != 6.0f)
+ {
+ Console.WriteLine("MathF.Round of an addressed instance value failed");
+ return Fail;
+ }
+ }
+
+ if (MathF.Round(program.instanceValueArray[0]) != 7.0f)
+ {
+ Console.WriteLine("MathF.Round of an instance value array (index 0) failed");
+ return Fail;
+ }
+
+ if (MathF.Round(program.instanceValueArray[1]) != 8.0f)
+ {
+ Console.WriteLine("MathF.Round of an instance value array (index 1) failed");
+ return Fail;
+ }
+
+ if (MathF.Round(program.instanceValueArray[2]) != 9.0f)
+ {
+ Console.WriteLine("MathF.Round of an instance value array (index 2) failed");
+ return Fail;
+ }
+
+ fixed (float* pInstanceValueArray = &program.instanceValueArray[0])
+ {
+ if (MathF.Round(pInstanceValueArray[0]) != 7.0f)
+ {
+ Console.WriteLine("MathF.Round of a addressed instance value array (index 0) failed");
+ return Fail;
+ }
+
+ if (MathF.Round(pInstanceValueArray[1]) != 8.0f)
+ {
+ Console.WriteLine("MathF.Round of a addressed instance value array (index 1) failed");
+ return Fail;
+ }
+
+ if (MathF.Round(pInstanceValueArray[2]) != 9.0f)
+ {
+ Console.WriteLine("MathF.Round of a addressed instance value array (index 2) failed");
+ return Fail;
+ }
+ }
+
+ if (MathF.Round(localValue) != 10.0f)
+ {
+ Console.WriteLine("MathF.Round of a local value failed");
+ return Fail;
+ }
+
+ float* pLocalValue = &localValue;
+
+ if (MathF.Round(*pLocalValue) != 10.0f)
+ {
+ Console.WriteLine("MathF.Round of an addressed local value failed");
+ return Fail;
+ }
+
+ return Pass;
+ }
+ }
+}
diff --git a/tests/src/JIT/Intrinsics/MathCeilingSingle_r.csproj b/tests/src/JIT/Intrinsics/MathCeilingSingle_r.csproj
new file mode 100644
index 0000000000..2bd64439fd
--- /dev/null
+++ b/tests/src/JIT/Intrinsics/MathCeilingSingle_r.csproj
@@ -0,0 +1,34 @@
+<?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>
+ <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+ </PropertyGroup>
+ <!-- Default configurations to help VS understand the configurations -->
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
+ <ItemGroup>
+ <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+ <Visible>False</Visible>
+ </CodeAnalysisDependentAssemblyPaths>
+ </ItemGroup>
+ <PropertyGroup>
+ <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+ <DebugType>None</DebugType>
+ <Optimize></Optimize>
+ </PropertyGroup>
+ <ItemGroup>
+ <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="MathCeilingSingle.cs" />
+ </ItemGroup>
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+ <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+</Project>
diff --git a/tests/src/JIT/Intrinsics/MathCeilingSingle_ro.csproj b/tests/src/JIT/Intrinsics/MathCeilingSingle_ro.csproj
new file mode 100644
index 0000000000..5ccf9a395a
--- /dev/null
+++ b/tests/src/JIT/Intrinsics/MathCeilingSingle_ro.csproj
@@ -0,0 +1,34 @@
+<?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>
+ <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+ </PropertyGroup>
+ <!-- Default configurations to help VS understand the configurations -->
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
+ <ItemGroup>
+ <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+ <Visible>False</Visible>
+ </CodeAnalysisDependentAssemblyPaths>
+ </ItemGroup>
+ <PropertyGroup>
+ <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+ <DebugType>None</DebugType>
+ <Optimize>True</Optimize>
+ </PropertyGroup>
+ <ItemGroup>
+ <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="MathCeilingSingle.cs" />
+ </ItemGroup>
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+ <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+</Project>
diff --git a/tests/src/JIT/Intrinsics/MathFloorDouble.cs b/tests/src/JIT/Intrinsics/MathFloorDouble.cs
new file mode 100644
index 0000000000..1835ade996
--- /dev/null
+++ b/tests/src/JIT/Intrinsics/MathFloorDouble.cs
@@ -0,0 +1,172 @@
+// 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;
+
+namespace MathFloorDoubleTest
+{
+ class Program
+ {
+ public const int Pass = 100;
+ public const int Fail = 0;
+
+ public const double constantValue = 0.0;
+
+ public static double staticValue = 1.1;
+
+ public static double[] staticValueArray = new double[]
+ {
+ 2.2,
+ 3.3,
+ 4.4
+ };
+
+ public double instanceValue = 5.5;
+
+ public double[] instanceValueArray = new double[]
+ {
+ 6.6,
+ 7.7,
+ 8.8
+ };
+
+ unsafe static int Main(string[] args)
+ {
+ double localValue = 9.9;
+
+ var program = new Program();
+
+ if (Math.Floor(constantValue) != 0.0)
+ {
+ Console.WriteLine("Math.Floor of a constant value failed");
+ return Fail;
+ }
+
+ if (Math.Floor(staticValue) != 1.0)
+ {
+ Console.WriteLine("Math.Floor of a static value failed");
+ return Fail;
+ }
+
+ fixed (double* pStaticValue = &staticValue)
+ {
+ if (Math.Floor(*pStaticValue) != 1.0)
+ {
+ Console.WriteLine("Math.Floor of an addressed static value failed");
+ return Fail;
+ }
+ }
+
+ if (Math.Floor(staticValueArray[0]) != 2.0)
+ {
+ Console.WriteLine("Math.Floor of a static value array (index 0) failed");
+ return Fail;
+ }
+
+ if (Math.Floor(staticValueArray[1]) != 3.0)
+ {
+ Console.WriteLine("Math.Floor of a static value array (index 1) failed");
+ return Fail;
+ }
+
+ if (Math.Floor(staticValueArray[2]) != 4.0)
+ {
+ Console.WriteLine("Math.Floor of a static value array (index 2) failed");
+ return Fail;
+ }
+
+ fixed (double* pStaticValueArray = &staticValueArray[0])
+ {
+ if (Math.Floor(pStaticValueArray[0]) != 2.0)
+ {
+ Console.WriteLine("Math.Floor of a addressed static value array (index 0) failed");
+ return Fail;
+ }
+
+ if (Math.Floor(pStaticValueArray[1]) != 3.0)
+ {
+ Console.WriteLine("Math.Floor of a addressed static value array (index 1) failed");
+ return Fail;
+ }
+
+ if (Math.Floor(pStaticValueArray[2]) != 4.0)
+ {
+ Console.WriteLine("Math.Floor of a addressed static value array (index 2) failed");
+ return Fail;
+ }
+ }
+
+ if (Math.Floor(program.instanceValue) != 5.0)
+ {
+ Console.WriteLine("Math.Floor of an instance value failed");
+ return Fail;
+ }
+
+ fixed (double* pInstanceValue = &program.instanceValue)
+ {
+ if (Math.Floor(*pInstanceValue) != 5.0)
+ {
+ Console.WriteLine("Math.Floor of an addressed instance value failed");
+ return Fail;
+ }
+ }
+
+ if (Math.Floor(program.instanceValueArray[0]) != 6.0)
+ {
+ Console.WriteLine("Math.Floor of an instance value array (index 0) failed");
+ return Fail;
+ }
+
+ if (Math.Floor(program.instanceValueArray[1]) != 7.0)
+ {
+ Console.WriteLine("Math.Floor of an instance value array (index 1) failed");
+ return Fail;
+ }
+
+ if (Math.Floor(program.instanceValueArray[2]) != 8.0)
+ {
+ Console.WriteLine("Math.Floor of an instance value array (index 2) failed");
+ return Fail;
+ }
+
+ fixed (double* pInstanceValueArray = &program.instanceValueArray[0])
+ {
+ if (Math.Floor(pInstanceValueArray[0]) != 6.0)
+ {
+ Console.WriteLine("Math.Floor of a addressed instance value array (index 0) failed");
+ return Fail;
+ }
+
+ if (Math.Floor(pInstanceValueArray[1]) != 7.0)
+ {
+ Console.WriteLine("Math.Floor of a addressed instance value array (index 1) failed");
+ return Fail;
+ }
+
+ if (Math.Floor(pInstanceValueArray[2]) != 8.0)
+ {
+ Console.WriteLine("Math.Floor of a addressed instance value array (index 2) failed");
+ return Fail;
+ }
+ }
+
+ if (Math.Floor(localValue) != 9.0)
+ {
+ Console.WriteLine("Math.Floor of a local value failed");
+ return Fail;
+ }
+
+ double* pLocalValue = &localValue;
+
+ if (Math.Floor(*pLocalValue) != 9.0)
+ {
+ Console.WriteLine("Math.Floor of an addressed local value failed");
+ return Fail;
+ }
+
+ return Pass;
+ }
+ }
+}
diff --git a/tests/src/JIT/Intrinsics/MathFloorDouble_r.csproj b/tests/src/JIT/Intrinsics/MathFloorDouble_r.csproj
new file mode 100644
index 0000000000..3f6bd4d495
--- /dev/null
+++ b/tests/src/JIT/Intrinsics/MathFloorDouble_r.csproj
@@ -0,0 +1,34 @@
+<?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>
+ <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+ </PropertyGroup>
+ <!-- Default configurations to help VS understand the configurations -->
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
+ <ItemGroup>
+ <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+ <Visible>False</Visible>
+ </CodeAnalysisDependentAssemblyPaths>
+ </ItemGroup>
+ <PropertyGroup>
+ <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+ <DebugType>None</DebugType>
+ <Optimize></Optimize>
+ </PropertyGroup>
+ <ItemGroup>
+ <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="MathFloorDouble.cs" />
+ </ItemGroup>
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+ <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+</Project>
diff --git a/tests/src/JIT/Intrinsics/MathFloorDouble_ro.csproj b/tests/src/JIT/Intrinsics/MathFloorDouble_ro.csproj
new file mode 100644
index 0000000000..c1830a1249
--- /dev/null
+++ b/tests/src/JIT/Intrinsics/MathFloorDouble_ro.csproj
@@ -0,0 +1,34 @@
+<?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>
+ <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+ </PropertyGroup>
+ <!-- Default configurations to help VS understand the configurations -->
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
+ <ItemGroup>
+ <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+ <Visible>False</Visible>
+ </CodeAnalysisDependentAssemblyPaths>
+ </ItemGroup>
+ <PropertyGroup>
+ <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+ <DebugType>None</DebugType>
+ <Optimize>True</Optimize>
+ </PropertyGroup>
+ <ItemGroup>
+ <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="MathFloorDouble.cs" />
+ </ItemGroup>
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+ <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+</Project>
diff --git a/tests/src/JIT/Intrinsics/MathFloorSingle.cs b/tests/src/JIT/Intrinsics/MathFloorSingle.cs
new file mode 100644
index 0000000000..5a312fbb69
--- /dev/null
+++ b/tests/src/JIT/Intrinsics/MathFloorSingle.cs
@@ -0,0 +1,172 @@
+// 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;
+
+namespace MathFloorSingleTest
+{
+ class Program
+ {
+ public const int Pass = 100;
+ public const int Fail = 0;
+
+ public const float constantValue = 0.0f;
+
+ public static float staticValue = 1.1f;
+
+ public static float[] staticValueArray = new float[]
+ {
+ 2.2f,
+ 3.3f,
+ 4.4f
+ };
+
+ public float instanceValue = 5.5f;
+
+ public float[] instanceValueArray = new float[]
+ {
+ 6.6f,
+ 7.7f,
+ 8.8f
+ };
+
+ unsafe static int Main(string[] args)
+ {
+ float localValue = 9.9f;
+
+ var program = new Program();
+
+ if (MathF.Floor(constantValue) != 0.0f)
+ {
+ Console.WriteLine("MathF.Floor of a constant value failed");
+ return Fail;
+ }
+
+ if (MathF.Floor(staticValue) != 1.0f)
+ {
+ Console.WriteLine("MathF.Floor of a static value failed");
+ return Fail;
+ }
+
+ fixed (float* pStaticValue = &staticValue)
+ {
+ if (MathF.Floor(*pStaticValue) != 1.0f)
+ {
+ Console.WriteLine("MathF.Floor of an addressed static value failed");
+ return Fail;
+ }
+ }
+
+ if (MathF.Floor(staticValueArray[0]) != 2.0f)
+ {
+ Console.WriteLine("MathF.Floor of a static value array (index 0) failed");
+ return Fail;
+ }
+
+ if (MathF.Floor(staticValueArray[1]) != 3.0f)
+ {
+ Console.WriteLine("MathF.Floor of a static value array (index 1) failed");
+ return Fail;
+ }
+
+ if (MathF.Floor(staticValueArray[2]) != 4.0f)
+ {
+ Console.WriteLine("MathF.Floor of a static value array (index 2) failed");
+ return Fail;
+ }
+
+ fixed (float* pStaticValueArray = &staticValueArray[0])
+ {
+ if (MathF.Floor(pStaticValueArray[0]) != 2.0f)
+ {
+ Console.WriteLine("MathF.Floor of a addressed static value array (index 0) failed");
+ return Fail;
+ }
+
+ if (MathF.Floor(pStaticValueArray[1]) != 3.0f)
+ {
+ Console.WriteLine("MathF.Floor of a addressed static value array (index 1) failed");
+ return Fail;
+ }
+
+ if (MathF.Floor(pStaticValueArray[2]) != 4.0f)
+ {
+ Console.WriteLine("MathF.Floor of a addressed static value array (index 2) failed");
+ return Fail;
+ }
+ }
+
+ if (MathF.Floor(program.instanceValue) != 5.0f)
+ {
+ Console.WriteLine("MathF.Floor of an instance value failed");
+ return Fail;
+ }
+
+ fixed (float* pInstanceValue = &program.instanceValue)
+ {
+ if (MathF.Floor(*pInstanceValue) != 5.0f)
+ {
+ Console.WriteLine("MathF.Floor of an addressed instance value failed");
+ return Fail;
+ }
+ }
+
+ if (MathF.Floor(program.instanceValueArray[0]) != 6.0f)
+ {
+ Console.WriteLine("MathF.Floor of an instance value array (index 0) failed");
+ return Fail;
+ }
+
+ if (MathF.Floor(program.instanceValueArray[1]) != 7.0f)
+ {
+ Console.WriteLine("MathF.Floor of an instance value array (index 1) failed");
+ return Fail;
+ }
+
+ if (MathF.Floor(program.instanceValueArray[2]) != 8.0f)
+ {
+ Console.WriteLine("MathF.Floor of an instance value array (index 2) failed");
+ return Fail;
+ }
+
+ fixed (float* pInstanceValueArray = &program.instanceValueArray[0])
+ {
+ if (MathF.Floor(pInstanceValueArray[0]) != 6.0f)
+ {
+ Console.WriteLine("MathF.Floor of a addressed instance value array (index 0) failed");
+ return Fail;
+ }
+
+ if (MathF.Floor(pInstanceValueArray[1]) != 7.0f)
+ {
+ Console.WriteLine("MathF.Floor of a addressed instance value array (index 1) failed");
+ return Fail;
+ }
+
+ if (MathF.Floor(pInstanceValueArray[2]) != 8.0f)
+ {
+ Console.WriteLine("MathF.Floor of a addressed instance value array (index 2) failed");
+ return Fail;
+ }
+ }
+
+ if (MathF.Floor(localValue) != 9.0f)
+ {
+ Console.WriteLine("MathF.Floor of a local value failed");
+ return Fail;
+ }
+
+ float* pLocalValue = &localValue;
+
+ if (MathF.Floor(*pLocalValue) != 9.0f)
+ {
+ Console.WriteLine("MathF.Floor of an addressed local value failed");
+ return Fail;
+ }
+
+ return Pass;
+ }
+ }
+}
diff --git a/tests/src/JIT/Intrinsics/MathFloorSingle_r.csproj b/tests/src/JIT/Intrinsics/MathFloorSingle_r.csproj
new file mode 100644
index 0000000000..bf0b95ad64
--- /dev/null
+++ b/tests/src/JIT/Intrinsics/MathFloorSingle_r.csproj
@@ -0,0 +1,34 @@
+<?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>
+ <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+ </PropertyGroup>
+ <!-- Default configurations to help VS understand the configurations -->
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
+ <ItemGroup>
+ <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+ <Visible>False</Visible>
+ </CodeAnalysisDependentAssemblyPaths>
+ </ItemGroup>
+ <PropertyGroup>
+ <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+ <DebugType>None</DebugType>
+ <Optimize></Optimize>
+ </PropertyGroup>
+ <ItemGroup>
+ <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="MathFloorSingle.cs" />
+ </ItemGroup>
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+ <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+</Project>
diff --git a/tests/src/JIT/Intrinsics/MathFloorSingle_ro.csproj b/tests/src/JIT/Intrinsics/MathFloorSingle_ro.csproj
new file mode 100644
index 0000000000..3a3d3e0d72
--- /dev/null
+++ b/tests/src/JIT/Intrinsics/MathFloorSingle_ro.csproj
@@ -0,0 +1,34 @@
+<?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>
+ <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+ </PropertyGroup>
+ <!-- Default configurations to help VS understand the configurations -->
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
+ <ItemGroup>
+ <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+ <Visible>False</Visible>
+ </CodeAnalysisDependentAssemblyPaths>
+ </ItemGroup>
+ <PropertyGroup>
+ <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+ <DebugType>None</DebugType>
+ <Optimize>True</Optimize>
+ </PropertyGroup>
+ <ItemGroup>
+ <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="MathFloorSingle.cs" />
+ </ItemGroup>
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+ <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+</Project>
diff --git a/tests/src/JIT/Intrinsics/MathRoundDouble.cs b/tests/src/JIT/Intrinsics/MathRoundDouble.cs
new file mode 100644
index 0000000000..f81afaf14e
--- /dev/null
+++ b/tests/src/JIT/Intrinsics/MathRoundDouble.cs
@@ -0,0 +1,172 @@
+// 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;
+
+namespace MathRoundDoubleTest
+{
+ class Program
+ {
+ public const int Pass = 100;
+ public const int Fail = 0;
+
+ public const double constantValue = 0.0;
+
+ public static double staticValue = 1.1;
+
+ public static double[] staticValueArray = new double[]
+ {
+ 2.2,
+ 3.3,
+ 4.4
+ };
+
+ public double instanceValue = 5.5;
+
+ public double[] instanceValueArray = new double[]
+ {
+ 6.6,
+ 7.7,
+ 8.8
+ };
+
+ unsafe static int Main(string[] args)
+ {
+ double localValue = 9.9;
+
+ var program = new Program();
+
+ if (Math.Round(constantValue) != 0.0)
+ {
+ Console.WriteLine("Math.Round of a constant value failed");
+ return Fail;
+ }
+
+ if (Math.Round(staticValue) != 1.0)
+ {
+ Console.WriteLine("Math.Round of a static value failed");
+ return Fail;
+ }
+
+ fixed (double* pStaticValue = &staticValue)
+ {
+ if (Math.Round(*pStaticValue) != 1.0)
+ {
+ Console.WriteLine("Math.Round of an addressed static value failed");
+ return Fail;
+ }
+ }
+
+ if (Math.Round(staticValueArray[0]) != 2.0)
+ {
+ Console.WriteLine("Math.Round of a static value array (index 0) failed");
+ return Fail;
+ }
+
+ if (Math.Round(staticValueArray[1]) != 3.0)
+ {
+ Console.WriteLine("Math.Round of a static value array (index 1) failed");
+ return Fail;
+ }
+
+ if (Math.Round(staticValueArray[2]) != 4.0)
+ {
+ Console.WriteLine("Math.Round of a static value array (index 2) failed");
+ return Fail;
+ }
+
+ fixed (double* pStaticValueArray = &staticValueArray[0])
+ {
+ if (Math.Round(pStaticValueArray[0]) != 2.0)
+ {
+ Console.WriteLine("Math.Round of a addressed static value array (index 0) failed");
+ return Fail;
+ }
+
+ if (Math.Round(pStaticValueArray[1]) != 3.0)
+ {
+ Console.WriteLine("Math.Round of a addressed static value array (index 1) failed");
+ return Fail;
+ }
+
+ if (Math.Round(pStaticValueArray[2]) != 4.0)
+ {
+ Console.WriteLine("Math.Round of a addressed static value array (index 2) failed");
+ return Fail;
+ }
+ }
+
+ if (Math.Round(program.instanceValue) != 6.0)
+ {
+ Console.WriteLine("Math.Round of an instance value failed");
+ return Fail;
+ }
+
+ fixed (double* pInstanceValue = &program.instanceValue)
+ {
+ if (Math.Round(*pInstanceValue) != 6.0)
+ {
+ Console.WriteLine("Math.Round of an addressed instance value failed");
+ return Fail;
+ }
+ }
+
+ if (Math.Round(program.instanceValueArray[0]) != 7.0)
+ {
+ Console.WriteLine("Math.Round of an instance value array (index 0) failed");
+ return Fail;
+ }
+
+ if (Math.Round(program.instanceValueArray[1]) != 8.0)
+ {
+ Console.WriteLine("Math.Round of an instance value array (index 1) failed");
+ return Fail;
+ }
+
+ if (Math.Round(program.instanceValueArray[2]) != 9.0)
+ {
+ Console.WriteLine("Math.Round of an instance value array (index 2) failed");
+ return Fail;
+ }
+
+ fixed (double* pInstanceValueArray = &program.instanceValueArray[0])
+ {
+ if (Math.Round(pInstanceValueArray[0]) != 7.0)
+ {
+ Console.WriteLine("Math.Round of a addressed instance value array (index 0) failed");
+ return Fail;
+ }
+
+ if (Math.Round(pInstanceValueArray[1]) != 8.0)
+ {
+ Console.WriteLine("Math.Round of a addressed instance value array (index 1) failed");
+ return Fail;
+ }
+
+ if (Math.Round(pInstanceValueArray[2]) != 9.0)
+ {
+ Console.WriteLine("Math.Round of a addressed instance value array (index 2) failed");
+ return Fail;
+ }
+ }
+
+ if (Math.Round(localValue) != 10.0)
+ {
+ Console.WriteLine("Math.Round of a local value failed");
+ return Fail;
+ }
+
+ double* pLocalValue = &localValue;
+
+ if (Math.Round(*pLocalValue) != 10.0)
+ {
+ Console.WriteLine("Math.Round of an addressed local value failed");
+ return Fail;
+ }
+
+ return Pass;
+ }
+ }
+}
diff --git a/tests/src/JIT/Intrinsics/MathRoundDouble_r.csproj b/tests/src/JIT/Intrinsics/MathRoundDouble_r.csproj
new file mode 100644
index 0000000000..056ef70526
--- /dev/null
+++ b/tests/src/JIT/Intrinsics/MathRoundDouble_r.csproj
@@ -0,0 +1,34 @@
+<?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>
+ <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+ </PropertyGroup>
+ <!-- Default configurations to help VS understand the configurations -->
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
+ <ItemGroup>
+ <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+ <Visible>False</Visible>
+ </CodeAnalysisDependentAssemblyPaths>
+ </ItemGroup>
+ <PropertyGroup>
+ <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+ <DebugType>None</DebugType>
+ <Optimize></Optimize>
+ </PropertyGroup>
+ <ItemGroup>
+ <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="MathRoundDouble.cs" />
+ </ItemGroup>
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+ <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+</Project>
diff --git a/tests/src/JIT/Intrinsics/MathRoundDouble_ro.csproj b/tests/src/JIT/Intrinsics/MathRoundDouble_ro.csproj
new file mode 100644
index 0000000000..e6f6a6f966
--- /dev/null
+++ b/tests/src/JIT/Intrinsics/MathRoundDouble_ro.csproj
@@ -0,0 +1,34 @@
+<?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>
+ <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+ </PropertyGroup>
+ <!-- Default configurations to help VS understand the configurations -->
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
+ <ItemGroup>
+ <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+ <Visible>False</Visible>
+ </CodeAnalysisDependentAssemblyPaths>
+ </ItemGroup>
+ <PropertyGroup>
+ <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+ <DebugType>None</DebugType>
+ <Optimize>True</Optimize>
+ </PropertyGroup>
+ <ItemGroup>
+ <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="MathRoundDouble.cs" />
+ </ItemGroup>
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+ <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+</Project>
diff --git a/tests/src/JIT/Intrinsics/MathRoundSingle.cs b/tests/src/JIT/Intrinsics/MathRoundSingle.cs
new file mode 100644
index 0000000000..aa6ca50187
--- /dev/null
+++ b/tests/src/JIT/Intrinsics/MathRoundSingle.cs
@@ -0,0 +1,172 @@
+// 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;
+
+namespace MathRoundSingleTest
+{
+ class Program
+ {
+ public const int Pass = 100;
+ public const int Fail = 0;
+
+ public const float constantValue = 0.0f;
+
+ public static float staticValue = 1.1f;
+
+ public static float[] staticValueArray = new float[]
+ {
+ 2.2f,
+ 3.3f,
+ 4.4f
+ };
+
+ public float instanceValue = 5.5f;
+
+ public float[] instanceValueArray = new float[]
+ {
+ 6.6f,
+ 7.7f,
+ 8.8f
+ };
+
+ unsafe static int Main(string[] args)
+ {
+ float localValue = 9.9f;
+
+ var program = new Program();
+
+ if (MathF.Round(constantValue) != 0.0f)
+ {
+ Console.WriteLine("MathF.Round of a constant value failed");
+ return Fail;
+ }
+
+ if (MathF.Round(staticValue) != 1.0f)
+ {
+ Console.WriteLine("MathF.Round of a static value failed");
+ return Fail;
+ }
+
+ fixed (float* pStaticValue = &staticValue)
+ {
+ if (MathF.Round(*pStaticValue) != 1.0f)
+ {
+ Console.WriteLine("MathF.Round of an addressed static value failed");
+ return Fail;
+ }
+ }
+
+ if (MathF.Round(staticValueArray[0]) != 2.0f)
+ {
+ Console.WriteLine("MathF.Round of a static value array (index 0) failed");
+ return Fail;
+ }
+
+ if (MathF.Round(staticValueArray[1]) != 3.0f)
+ {
+ Console.WriteLine("MathF.Round of a static value array (index 1) failed");
+ return Fail;
+ }
+
+ if (MathF.Round(staticValueArray[2]) != 4.0f)
+ {
+ Console.WriteLine("MathF.Round of a static value array (index 2) failed");
+ return Fail;
+ }
+
+ fixed (float* pStaticValueArray = &staticValueArray[0])
+ {
+ if (MathF.Round(pStaticValueArray[0]) != 2.0f)
+ {
+ Console.WriteLine("MathF.Round of a addressed static value array (index 0) failed");
+ return Fail;
+ }
+
+ if (MathF.Round(pStaticValueArray[1]) != 3.0f)
+ {
+ Console.WriteLine("MathF.Round of a addressed static value array (index 1) failed");
+ return Fail;
+ }
+
+ if (MathF.Round(pStaticValueArray[2]) != 4.0f)
+ {
+ Console.WriteLine("MathF.Round of a addressed static value array (index 2) failed");
+ return Fail;
+ }
+ }
+
+ if (MathF.Round(program.instanceValue) != 6.0f)
+ {
+ Console.WriteLine("MathF.Round of an instance value failed");
+ return Fail;
+ }
+
+ fixed (float* pInstanceValue = &program.instanceValue)
+ {
+ if (MathF.Round(*pInstanceValue) != 6.0f)
+ {
+ Console.WriteLine("MathF.Round of an addressed instance value failed");
+ return Fail;
+ }
+ }
+
+ if (MathF.Round(program.instanceValueArray[0]) != 7.0f)
+ {
+ Console.WriteLine("MathF.Round of an instance value array (index 0) failed");
+ return Fail;
+ }
+
+ if (MathF.Round(program.instanceValueArray[1]) != 8.0f)
+ {
+ Console.WriteLine("MathF.Round of an instance value array (index 1) failed");
+ return Fail;
+ }
+
+ if (MathF.Round(program.instanceValueArray[2]) != 9.0f)
+ {
+ Console.WriteLine("MathF.Round of an instance value array (index 2) failed");
+ return Fail;
+ }
+
+ fixed (float* pInstanceValueArray = &program.instanceValueArray[0])
+ {
+ if (MathF.Round(pInstanceValueArray[0]) != 7.0f)
+ {
+ Console.WriteLine("MathF.Round of a addressed instance value array (index 0) failed");
+ return Fail;
+ }
+
+ if (MathF.Round(pInstanceValueArray[1]) != 8.0f)
+ {
+ Console.WriteLine("MathF.Round of a addressed instance value array (index 1) failed");
+ return Fail;
+ }
+
+ if (MathF.Round(pInstanceValueArray[2]) != 9.0f)
+ {
+ Console.WriteLine("MathF.Round of a addressed instance value array (index 2) failed");
+ return Fail;
+ }
+ }
+
+ if (MathF.Round(localValue) != 10.0f)
+ {
+ Console.WriteLine("MathF.Round of a local value failed");
+ return Fail;
+ }
+
+ float* pLocalValue = &localValue;
+
+ if (MathF.Round(*pLocalValue) != 10.0f)
+ {
+ Console.WriteLine("MathF.Round of an addressed local value failed");
+ return Fail;
+ }
+
+ return Pass;
+ }
+ }
+}
diff --git a/tests/src/JIT/Intrinsics/MathRoundSingle_r.csproj b/tests/src/JIT/Intrinsics/MathRoundSingle_r.csproj
new file mode 100644
index 0000000000..fa1845c11b
--- /dev/null
+++ b/tests/src/JIT/Intrinsics/MathRoundSingle_r.csproj
@@ -0,0 +1,34 @@
+<?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>
+ <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+ </PropertyGroup>
+ <!-- Default configurations to help VS understand the configurations -->
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
+ <ItemGroup>
+ <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+ <Visible>False</Visible>
+ </CodeAnalysisDependentAssemblyPaths>
+ </ItemGroup>
+ <PropertyGroup>
+ <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+ <DebugType>None</DebugType>
+ <Optimize></Optimize>
+ </PropertyGroup>
+ <ItemGroup>
+ <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="MathRoundSingle.cs" />
+ </ItemGroup>
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+ <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+</Project>
diff --git a/tests/src/JIT/Intrinsics/MathRoundSingle_ro.csproj b/tests/src/JIT/Intrinsics/MathRoundSingle_ro.csproj
new file mode 100644
index 0000000000..d8db5f66f3
--- /dev/null
+++ b/tests/src/JIT/Intrinsics/MathRoundSingle_ro.csproj
@@ -0,0 +1,34 @@
+<?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>
+ <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+ </PropertyGroup>
+ <!-- Default configurations to help VS understand the configurations -->
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
+ <ItemGroup>
+ <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+ <Visible>False</Visible>
+ </CodeAnalysisDependentAssemblyPaths>
+ </ItemGroup>
+ <PropertyGroup>
+ <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+ <DebugType>None</DebugType>
+ <Optimize>True</Optimize>
+ </PropertyGroup>
+ <ItemGroup>
+ <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="MathRoundSingle.cs" />
+ </ItemGroup>
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+ <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+</Project>