Skip to content

Commit

Permalink
Add Methodical/NaN test cases for JIT.
Browse files Browse the repository at this point in the history
Add Methodical/NaN test cases for JIT. Related proj, config,
and sln files added and updated. Passed build, buildtest, runtest.
Also added Generic/Exceptions, Methodical/MDArray/DataTypes,
Directed/StructPromote tests to AllTestProject.sln.
  • Loading branch information
Bengu Li committed May 8, 2015
1 parent 411577b commit c9d4a03
Show file tree
Hide file tree
Showing 17 changed files with 11,419 additions and 0 deletions.
70 changes: 70 additions & 0 deletions tests/src/AllTestProjects.sln
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,26 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Fields", "Fields", "{469D4D
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Fields", "JIT\Generics\Fields\Fields.csproj", "{F40B2B5B-4C42-4BD8-8CAF-8C96856BAC0F}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "StructPromote", "StructPromote", "{A8B34174-E462-48BE-975C-604B8B1DB0A0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StructPromote", "JIT\Directed\StructPromote\StructPromote.csproj", "{11835CDF-F5AA-42B9-9FE6-6F94EB9A08B9}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MDArray", "MDArray", "{1E30345B-4538-426B-8F15-94C7EDD9F6A1}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DataTypes", "DataTypes", "{48E311DE-F4D4-4F54-8C2B-FEDA15FE2D40}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Methodical", "Methodical", "{D83DE650-AD2D-4122-9AE2-53AB5364D032}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataTypes", "JIT\Methodical\MDArray\DataTypes\DataTypes.csproj", "{1A50E251-BD04-4049-9745-770CFF672093}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Exceptions", "Exceptions", "{165B27F0-A2BA-4961-B718-0E381B8B92BD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Exceptions", "JIT\Generics\Exceptions\Exceptions.csproj", "{E16B0693-80CF-422F-AB4B-B5150FDF5140}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NaN", "NaN", "{06633516-0C78-433B-BFFB-A8BCE5006CB7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NaN", "JIT\Methodical\NaN\NaN.csproj", "{5FEB6365-EB6C-4D4D-9DAA-E5E2EEA5A1FF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -437,6 +457,46 @@ Global
{F40B2B5B-4C42-4BD8-8CAF-8C96856BAC0F}.Release|Mixed Platforms.Build.0 = Release|x64
{F40B2B5B-4C42-4BD8-8CAF-8C96856BAC0F}.Release|x64.ActiveCfg = Release|x64
{F40B2B5B-4C42-4BD8-8CAF-8C96856BAC0F}.Release|x64.Build.0 = Release|x64
{11835CDF-F5AA-42B9-9FE6-6F94EB9A08B9}.Debug|Any CPU.ActiveCfg = Debug|x64
{11835CDF-F5AA-42B9-9FE6-6F94EB9A08B9}.Debug|Mixed Platforms.ActiveCfg = Debug|x64
{11835CDF-F5AA-42B9-9FE6-6F94EB9A08B9}.Debug|Mixed Platforms.Build.0 = Debug|x64
{11835CDF-F5AA-42B9-9FE6-6F94EB9A08B9}.Debug|x64.ActiveCfg = Debug|x64
{11835CDF-F5AA-42B9-9FE6-6F94EB9A08B9}.Debug|x64.Build.0 = Debug|x64
{11835CDF-F5AA-42B9-9FE6-6F94EB9A08B9}.Release|Any CPU.ActiveCfg = Release|x64
{11835CDF-F5AA-42B9-9FE6-6F94EB9A08B9}.Release|Mixed Platforms.ActiveCfg = Release|x64
{11835CDF-F5AA-42B9-9FE6-6F94EB9A08B9}.Release|Mixed Platforms.Build.0 = Release|x64
{11835CDF-F5AA-42B9-9FE6-6F94EB9A08B9}.Release|x64.ActiveCfg = Release|x64
{11835CDF-F5AA-42B9-9FE6-6F94EB9A08B9}.Release|x64.Build.0 = Release|x64
{1A50E251-BD04-4049-9745-770CFF672093}.Debug|Any CPU.ActiveCfg = Debug|x64
{1A50E251-BD04-4049-9745-770CFF672093}.Debug|Mixed Platforms.ActiveCfg = Debug|x64
{1A50E251-BD04-4049-9745-770CFF672093}.Debug|Mixed Platforms.Build.0 = Debug|x64
{1A50E251-BD04-4049-9745-770CFF672093}.Debug|x64.ActiveCfg = Debug|x64
{1A50E251-BD04-4049-9745-770CFF672093}.Debug|x64.Build.0 = Debug|x64
{1A50E251-BD04-4049-9745-770CFF672093}.Release|Any CPU.ActiveCfg = Release|x64
{1A50E251-BD04-4049-9745-770CFF672093}.Release|Mixed Platforms.ActiveCfg = Release|x64
{1A50E251-BD04-4049-9745-770CFF672093}.Release|Mixed Platforms.Build.0 = Release|x64
{1A50E251-BD04-4049-9745-770CFF672093}.Release|x64.ActiveCfg = Release|x64
{1A50E251-BD04-4049-9745-770CFF672093}.Release|x64.Build.0 = Release|x64
{E16B0693-80CF-422F-AB4B-B5150FDF5140}.Debug|Any CPU.ActiveCfg = Debug|x64
{E16B0693-80CF-422F-AB4B-B5150FDF5140}.Debug|Mixed Platforms.ActiveCfg = Debug|x64
{E16B0693-80CF-422F-AB4B-B5150FDF5140}.Debug|Mixed Platforms.Build.0 = Debug|x64
{E16B0693-80CF-422F-AB4B-B5150FDF5140}.Debug|x64.ActiveCfg = Debug|x64
{E16B0693-80CF-422F-AB4B-B5150FDF5140}.Debug|x64.Build.0 = Debug|x64
{E16B0693-80CF-422F-AB4B-B5150FDF5140}.Release|Any CPU.ActiveCfg = Release|x64
{E16B0693-80CF-422F-AB4B-B5150FDF5140}.Release|Mixed Platforms.ActiveCfg = Release|x64
{E16B0693-80CF-422F-AB4B-B5150FDF5140}.Release|Mixed Platforms.Build.0 = Release|x64
{E16B0693-80CF-422F-AB4B-B5150FDF5140}.Release|x64.ActiveCfg = Release|x64
{E16B0693-80CF-422F-AB4B-B5150FDF5140}.Release|x64.Build.0 = Release|x64
{5FEB6365-EB6C-4D4D-9DAA-E5E2EEA5A1FF}.Debug|Any CPU.ActiveCfg = Debug|x64
{5FEB6365-EB6C-4D4D-9DAA-E5E2EEA5A1FF}.Debug|Mixed Platforms.ActiveCfg = Debug|x64
{5FEB6365-EB6C-4D4D-9DAA-E5E2EEA5A1FF}.Debug|Mixed Platforms.Build.0 = Debug|x64
{5FEB6365-EB6C-4D4D-9DAA-E5E2EEA5A1FF}.Debug|x64.ActiveCfg = Debug|x64
{5FEB6365-EB6C-4D4D-9DAA-E5E2EEA5A1FF}.Debug|x64.Build.0 = Debug|x64
{5FEB6365-EB6C-4D4D-9DAA-E5E2EEA5A1FF}.Release|Any CPU.ActiveCfg = Release|x64
{5FEB6365-EB6C-4D4D-9DAA-E5E2EEA5A1FF}.Release|Mixed Platforms.ActiveCfg = Release|x64
{5FEB6365-EB6C-4D4D-9DAA-E5E2EEA5A1FF}.Release|Mixed Platforms.Build.0 = Release|x64
{5FEB6365-EB6C-4D4D-9DAA-E5E2EEA5A1FF}.Release|x64.ActiveCfg = Release|x64
{5FEB6365-EB6C-4D4D-9DAA-E5E2EEA5A1FF}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -449,6 +509,7 @@ Global
{D9FFDA0F-00A2-458C-B3D3-77D0811E969E} = {F03E5C26-F7BE-4BEF-9CBC-EAFC5A2C7760}
{4528D9E6-C6F8-448E-BD36-5E5DAAFE90D3} = {F03E5C26-F7BE-4BEF-9CBC-EAFC5A2C7760}
{0957EF12-6D74-4438-BAD1-D720433C2162} = {F03E5C26-F7BE-4BEF-9CBC-EAFC5A2C7760}
{D83DE650-AD2D-4122-9AE2-53AB5364D032} = {F03E5C26-F7BE-4BEF-9CBC-EAFC5A2C7760}
{B6FB99A0-1E53-4806-AE96-3A157F8B4DFD} = {3E36F081-F511-4C52-BC3D-2EEFECD3E880}
{01516861-E37C-433B-9D12-CA4F8E05CB13} = {3E36F081-F511-4C52-BC3D-2EEFECD3E880}
{9CF3FD0C-3643-4F57-A57C-492258FF1BF0} = {C86BB69B-B83E-4656-825F-50CADB38D344}
Expand Down Expand Up @@ -477,6 +538,7 @@ Global
{168FB13B-74F9-4056-BF11-A46F2DAAADF8} = {86AB78FA-656D-47D1-B156-F8165542A6C1}
{3AC4E363-B239-4D48-AEB8-A9177554E156} = {86AB78FA-656D-47D1-B156-F8165542A6C1}
{BA784A0F-E788-40CC-A76D-EB4041808897} = {86AB78FA-656D-47D1-B156-F8165542A6C1}
{A8B34174-E462-48BE-975C-604B8B1DB0A0} = {86AB78FA-656D-47D1-B156-F8165542A6C1}
{BA57FEA2-9416-4FE6-9767-7C63CE8EFBC7} = {168FB13B-74F9-4056-BF11-A46F2DAAADF8}
{6B543CA2-10A2-4771-9F93-1733AA7A2DB8} = {1E0A9AAE-133F-4881-8DC6-571F12B96B8B}
{39DD9A75-2535-4EBD-94A4-C7DF7EF12CF5} = {6B543CA2-10A2-4771-9F93-1733AA7A2DB8}
Expand All @@ -493,6 +555,7 @@ Global
{472DA1F4-C446-434B-906C-A0F2899C279B} = {BA784A0F-E788-40CC-A76D-EB4041808897}
{C3F22F91-FE0E-4181-864B-D7EE7225382D} = {4528D9E6-C6F8-448E-BD36-5E5DAAFE90D3}
{469D4D65-45B3-4641-9C04-480102731EF9} = {4528D9E6-C6F8-448E-BD36-5E5DAAFE90D3}
{165B27F0-A2BA-4961-B718-0E381B8B92BD} = {4528D9E6-C6F8-448E-BD36-5E5DAAFE90D3}
{C5825007-742C-4F16-BAB5-09D6EAF2AEF6} = {C3F22F91-FE0E-4181-864B-D7EE7225382D}
{1E8B3DDB-15DC-4BB9-BAFB-8252848A8784} = {C3F22F91-FE0E-4181-864B-D7EE7225382D}
{A1C4D795-DE5B-4CB0-BFF6-13E1D5A787FD} = {C5825007-742C-4F16-BAB5-09D6EAF2AEF6}
Expand All @@ -506,5 +569,12 @@ Global
{8C754381-F489-4B5F-885A-415D323D88BF} = {0957EF12-6D74-4438-BAD1-D720433C2162}
{757F1684-39BD-4705-91F1-FE16BD5B1523} = {8C754381-F489-4B5F-885A-415D323D88BF}
{F40B2B5B-4C42-4BD8-8CAF-8C96856BAC0F} = {469D4D65-45B3-4641-9C04-480102731EF9}
{11835CDF-F5AA-42B9-9FE6-6F94EB9A08B9} = {A8B34174-E462-48BE-975C-604B8B1DB0A0}
{48E311DE-F4D4-4F54-8C2B-FEDA15FE2D40} = {1E30345B-4538-426B-8F15-94C7EDD9F6A1}
{1A50E251-BD04-4049-9745-770CFF672093} = {48E311DE-F4D4-4F54-8C2B-FEDA15FE2D40}
{1E30345B-4538-426B-8F15-94C7EDD9F6A1} = {D83DE650-AD2D-4122-9AE2-53AB5364D032}
{06633516-0C78-433B-BFFB-A8BCE5006CB7} = {D83DE650-AD2D-4122-9AE2-53AB5364D032}
{E16B0693-80CF-422F-AB4B-B5150FDF5140} = {165B27F0-A2BA-4961-B718-0E381B8B92BD}
{5FEB6365-EB6C-4D4D-9DAA-E5E2EEA5A1FF} = {06633516-0C78-433B-BFFB-A8BCE5006CB7}
EndGlobalSection
EndGlobal
19 changes: 19 additions & 0 deletions tests/src/JIT/Methodical/NaN/NaN.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/Methodical/NaN/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>
94 changes: 94 additions & 0 deletions tests/src/JIT/Methodical/NaN/arithm32.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//

namespace JitTest
{
using System;

class Test
{
static void RunTests(float nan, float plusinf, float minusinf)
{
if (!Single.IsNaN(nan + nan))
throw new Exception("! Single.IsNaN(nan + nan)");
if (!Single.IsNaN(nan + plusinf))
throw new Exception("! Single.IsNaN(nan + plusinf)");
if (!Single.IsNaN(nan + minusinf))
throw new Exception("! Single.IsNaN(nan + minusinf)");
if (!Single.IsNaN(plusinf + nan))
throw new Exception("! Single.IsNaN(plusinf + nan)");
if (!Single.IsPositiveInfinity(plusinf + plusinf))
throw new Exception("! Single.IsPositiveInfinity(plusinf + plusinf)");
if (!Single.IsNaN(plusinf + minusinf))
throw new Exception("! Single.IsNaN(plusinf + minusinf)");
if (!Single.IsNaN(minusinf + nan))
throw new Exception("! Single.IsNaN(minusinf + nan)");
if (!Single.IsNaN(minusinf + plusinf))
throw new Exception("! Single.IsNaN(minusinf + plusinf)");
if (!Single.IsNegativeInfinity(minusinf + minusinf))
throw new Exception("! Single.IsNegativeInfinity(minusinf + minusinf)");
if (!Single.IsNaN(nan + nan))
throw new Exception("! Single.IsNaN(nan + nan)");
if (!Single.IsNaN(nan + plusinf))
throw new Exception("! Single.IsNaN(nan + plusinf)");
if (!Single.IsNaN(nan + minusinf))
throw new Exception("! Single.IsNaN(nan + minusinf)");
if (!Single.IsNaN(plusinf + nan))
throw new Exception("! Single.IsNaN(plusinf + nan)");
if (!Single.IsPositiveInfinity(plusinf + plusinf))
throw new Exception("! Single.IsPositiveInfinity(plusinf + plusinf)");
if (!Single.IsNaN(plusinf + minusinf))
throw new Exception("! Single.IsNaN(plusinf + minusinf)");
if (!Single.IsNaN(minusinf + nan))
throw new Exception("! Single.IsNaN(minusinf + nan)");
if (!Single.IsNaN(minusinf + plusinf))
throw new Exception("! Single.IsNaN(minusinf + plusinf)");
if (!Single.IsNegativeInfinity(minusinf + minusinf))
throw new Exception("! Single.IsNegativeInfinity(minusinf + minusinf)");
if (!Single.IsNaN(nan + nan))
throw new Exception("! Single.IsNaN(nan + nan)");
if (!Single.IsNaN(nan + plusinf))
throw new Exception("! Single.IsNaN(nan + plusinf)");
if (!Single.IsNaN(nan + minusinf))
throw new Exception("! Single.IsNaN(nan + minusinf)");
if (!Single.IsNaN(plusinf + nan))
throw new Exception("! Single.IsNaN(plusinf + nan)");
if (!Single.IsPositiveInfinity(plusinf + plusinf))
throw new Exception("! Single.IsPositiveInfinity(plusinf + plusinf)");
if (!Single.IsNaN(plusinf + minusinf))
throw new Exception("! Single.IsNaN(plusinf + minusinf)");
if (!Single.IsNaN(minusinf + nan))
throw new Exception("! Single.IsNaN(minusinf + nan)");
if (!Single.IsNaN(minusinf + plusinf))
throw new Exception("! Single.IsNaN(minusinf + plusinf)");
if (!Single.IsNegativeInfinity(minusinf + minusinf))
throw new Exception("! Single.IsNegativeInfinity(minusinf + minusinf)");
if (!Single.IsNaN(nan + nan))
throw new Exception("! Single.IsNaN(nan + nan)");
if (!Single.IsNaN(nan + plusinf))
throw new Exception("! Single.IsNaN(nan + plusinf)");
if (!Single.IsNaN(nan + minusinf))
throw new Exception("! Single.IsNaN(nan + minusinf)");
if (!Single.IsNaN(plusinf + nan))
throw new Exception("! Single.IsNaN(plusinf + nan)");
if (!Single.IsPositiveInfinity(plusinf + plusinf))
throw new Exception("! Single.IsPositiveInfinity(plusinf + plusinf)");
if (!Single.IsNaN(plusinf + minusinf))
throw new Exception("! Single.IsNaN(plusinf + minusinf)");
if (!Single.IsNaN(minusinf + nan))
throw new Exception("! Single.IsNaN(minusinf + nan)");
if (!Single.IsNaN(minusinf + plusinf))
throw new Exception("! Single.IsNaN(minusinf + plusinf)");
if (!Single.IsNegativeInfinity(minusinf + minusinf))
throw new Exception("! Single.IsNegativeInfinity(minusinf + minusinf)");
}

static int Main()
{
RunTests(Single.NaN, Single.PositiveInfinity, Single.NegativeInfinity);
Console.WriteLine("=== PASSED ===");
return 100;
}
}
}
Loading

0 comments on commit c9d4a03

Please sign in to comment.