summaryrefslogtreecommitdiff
path: root/tests/src/JIT/Directed
diff options
context:
space:
mode:
authorPat Gavlin <pagavlin@microsoft.com>2015-05-18 09:53:47 -0700
committerPat Gavlin <pagavlin@microsoft.com>2015-05-19 13:55:42 -0700
commit31e98f2aa7308d2beebeb38af715fb2244cdba46 (patch)
tree58ce245d40d61c699d5c645c31cf509fcadd9f79 /tests/src/JIT/Directed
parent10990901f7bcf370415ff3cb3f042a79c64b1c22 (diff)
downloadcoreclr-31e98f2aa7308d2beebeb38af715fb2244cdba46.tar.gz
coreclr-31e98f2aa7308d2beebeb38af715fb2244cdba46.tar.bz2
coreclr-31e98f2aa7308d2beebeb38af715fb2244cdba46.zip
Import JIT tests.
This brings over most of the tests from `JIT/Directed` that can target CoreCLR.
Diffstat (limited to 'tests/src/JIT/Directed')
-rw-r--r--tests/src/JIT/Directed/Arrays/complex2.cs76
-rw-r--r--tests/src/JIT/Directed/Arrays/simple2.cs47
-rw-r--r--tests/src/JIT/Directed/StrAccess/StrAccess.csproj19
-rw-r--r--tests/src/JIT/Directed/StrAccess/app.config27
-rw-r--r--tests/src/JIT/Directed/StrAccess/cs_template.proj42
-rw-r--r--tests/src/JIT/Directed/StrAccess/packages.config6
-rw-r--r--tests/src/JIT/Directed/StrAccess/straccess1.cs214
-rw-r--r--tests/src/JIT/Directed/StrAccess/straccess2.cs233
-rw-r--r--tests/src/JIT/Directed/StrAccess/straccess3.cs197
-rw-r--r--tests/src/JIT/Directed/StrAccess/straccess4.cs197
-rw-r--r--tests/src/JIT/Directed/UnrollLoop/Dev10_846218.cs63
-rw-r--r--tests/src/JIT/Directed/UnrollLoop/UnrollLoop.csproj19
-rw-r--r--tests/src/JIT/Directed/UnrollLoop/app.config27
-rw-r--r--tests/src/JIT/Directed/UnrollLoop/cs_template.proj42
-rw-r--r--tests/src/JIT/Directed/UnrollLoop/loop1.cs251
-rw-r--r--tests/src/JIT/Directed/UnrollLoop/loop4.cs424
-rw-r--r--tests/src/JIT/Directed/UnrollLoop/packages.config6
-rw-r--r--tests/src/JIT/Directed/coverage/flowgraph/app.config27
-rw-r--r--tests/src/JIT/Directed/coverage/flowgraph/cs_template.proj42
-rw-r--r--tests/src/JIT/Directed/coverage/flowgraph/flowgraph.csproj19
-rw-r--r--tests/src/JIT/Directed/coverage/flowgraph/packages.config6
-rw-r--r--tests/src/JIT/Directed/coverage/flowgraph/xaddmuly.cs26
-rw-r--r--tests/src/JIT/Directed/coverage/oldtests/33objref.cs184
-rw-r--r--tests/src/JIT/Directed/coverage/oldtests/app.config27
-rw-r--r--tests/src/JIT/Directed/coverage/oldtests/cs_template.proj42
-rw-r--r--tests/src/JIT/Directed/coverage/oldtests/cse1.cs171
-rw-r--r--tests/src/JIT/Directed/coverage/oldtests/cse2.cs544
-rw-r--r--tests/src/JIT/Directed/coverage/oldtests/lclfldadd.cs559
-rw-r--r--tests/src/JIT/Directed/coverage/oldtests/lclflddiv.cs559
-rw-r--r--tests/src/JIT/Directed/coverage/oldtests/lclfldmul.cs559
-rw-r--r--tests/src/JIT/Directed/coverage/oldtests/lclfldrem.cs559
-rw-r--r--tests/src/JIT/Directed/coverage/oldtests/lclfldsub.cs559
-rw-r--r--tests/src/JIT/Directed/coverage/oldtests/oldtests.csproj19
-rw-r--r--tests/src/JIT/Directed/coverage/oldtests/packages.config6
-rw-r--r--tests/src/JIT/Directed/intrinsic/interlocked/IntrinsicTest_Overflow.cs147
-rw-r--r--tests/src/JIT/Directed/intrinsic/interlocked/app.config27
-rw-r--r--tests/src/JIT/Directed/intrinsic/interlocked/cmpxchg.cs54
-rw-r--r--tests/src/JIT/Directed/intrinsic/interlocked/cs_template.proj42
-rw-r--r--tests/src/JIT/Directed/intrinsic/interlocked/cse_cmpxchg.cs26
-rw-r--r--tests/src/JIT/Directed/intrinsic/interlocked/interlocked.csproj19
-rw-r--r--tests/src/JIT/Directed/intrinsic/interlocked/nullchecksuppress.cs40
-rw-r--r--tests/src/JIT/Directed/intrinsic/interlocked/packages.config7
-rw-r--r--tests/src/JIT/Directed/intrinsic/interlocked/regalloc1.cs77
-rw-r--r--tests/src/JIT/Directed/intrinsic/interlocked/regalloc2.cs78
-rw-r--r--tests/src/JIT/Directed/intrinsic/pow/app.config27
-rw-r--r--tests/src/JIT/Directed/intrinsic/pow/cs_template.proj42
-rw-r--r--tests/src/JIT/Directed/intrinsic/pow/packages.config6
-rw-r--r--tests/src/JIT/Directed/intrinsic/pow/pow.csproj19
-rw-r--r--tests/src/JIT/Directed/intrinsic/pow/pow0.cs64
-rw-r--r--tests/src/JIT/Directed/intrinsic/pow/pow1.cs151
-rw-r--r--tests/src/JIT/Directed/intrinsic/pow/pow2.cs173
-rw-r--r--tests/src/JIT/Directed/intrinsic/pow/pow3.cs122
-rw-r--r--tests/src/JIT/Directed/lifetime/app.config27
-rw-r--r--tests/src/JIT/Directed/lifetime/cs_template.proj42
-rw-r--r--tests/src/JIT/Directed/lifetime/lifetime.csproj19
-rw-r--r--tests/src/JIT/Directed/lifetime/lifetime1.cs159
-rw-r--r--tests/src/JIT/Directed/lifetime/lifetime2.cs210
-rw-r--r--tests/src/JIT/Directed/lifetime/packages.config6
-rw-r--r--tests/src/JIT/Directed/localloc/app.config27
-rw-r--r--tests/src/JIT/Directed/localloc/cs_template.proj42
-rw-r--r--tests/src/JIT/Directed/localloc/localloc.csproj19
-rw-r--r--tests/src/JIT/Directed/localloc/localloc3.cs88
-rw-r--r--tests/src/JIT/Directed/localloc/packages.config6
-rw-r--r--tests/src/JIT/Directed/newarr/app.config27
-rw-r--r--tests/src/JIT/Directed/newarr/cs_template.proj42
-rw-r--r--tests/src/JIT/Directed/newarr/newarr.cs100
-rw-r--r--tests/src/JIT/Directed/newarr/newarr.csproj19
-rw-r--r--tests/src/JIT/Directed/newarr/packages.config6
-rw-r--r--tests/src/JIT/Directed/shift/app.config27
-rw-r--r--tests/src/JIT/Directed/shift/cs_template.proj42
-rw-r--r--tests/src/JIT/Directed/shift/int16.cs155
-rw-r--r--tests/src/JIT/Directed/shift/int32.cs155
-rw-r--r--tests/src/JIT/Directed/shift/int64.cs155
-rw-r--r--tests/src/JIT/Directed/shift/packages.config6
-rw-r--r--tests/src/JIT/Directed/shift/shift.csproj19
-rw-r--r--tests/src/JIT/Directed/shift/uint16.cs155
-rw-r--r--tests/src/JIT/Directed/shift/uint32.cs155
-rw-r--r--tests/src/JIT/Directed/shift/uint64.cs155
-rw-r--r--tests/src/JIT/Directed/shift/uint8.cs155
79 files changed, 8937 insertions, 0 deletions
diff --git a/tests/src/JIT/Directed/Arrays/complex2.cs b/tests/src/JIT/Directed/Arrays/complex2.cs
new file mode 100644
index 0000000000..e951b6f2b2
--- /dev/null
+++ b/tests/src/JIT/Directed/Arrays/complex2.cs
@@ -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;
+ }
+ }
+}
diff --git a/tests/src/JIT/Directed/Arrays/simple2.cs b/tests/src/JIT/Directed/Arrays/simple2.cs
new file mode 100644
index 0000000000..e2679d4b3b
--- /dev/null
+++ b/tests/src/JIT/Directed/Arrays/simple2.cs
@@ -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;
+ }
+ }
+}
diff --git a/tests/src/JIT/Directed/StrAccess/StrAccess.csproj b/tests/src/JIT/Directed/StrAccess/StrAccess.csproj
new file mode 100644
index 0000000000..33b2928ebc
--- /dev/null
+++ b/tests/src/JIT/Directed/StrAccess/StrAccess.csproj
@@ -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>
diff --git a/tests/src/JIT/Directed/StrAccess/app.config b/tests/src/JIT/Directed/StrAccess/app.config
new file mode 100644
index 0000000000..62803f5972
--- /dev/null
+++ b/tests/src/JIT/Directed/StrAccess/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> \ No newline at end of file
diff --git a/tests/src/JIT/Directed/StrAccess/cs_template.proj b/tests/src/JIT/Directed/StrAccess/cs_template.proj
new file mode 100644
index 0000000000..adc2f21e14
--- /dev/null
+++ b/tests/src/JIT/Directed/StrAccess/cs_template.proj
@@ -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>
diff --git a/tests/src/JIT/Directed/StrAccess/packages.config b/tests/src/JIT/Directed/StrAccess/packages.config
new file mode 100644
index 0000000000..06d3d11ead
--- /dev/null
+++ b/tests/src/JIT/Directed/StrAccess/packages.config
@@ -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>
diff --git a/tests/src/JIT/Directed/StrAccess/straccess1.cs b/tests/src/JIT/Directed/StrAccess/straccess1.cs
new file mode 100644
index 0000000000..46cf771027
--- /dev/null
+++ b/tests/src/JIT/Directed/StrAccess/straccess1.cs
@@ -0,0 +1,214 @@
+// 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 String str;
+ public char b0, b1, b2, b3, b4, b5, b6;
+}
+
+internal class CL
+{
+ public String str = "test string";
+ public char b0, b1, b2, b3, b4, b5, b6;
+}
+
+internal class StrAccess1
+{
+ public static String str1 = "test string";
+ public static String[,] str2darr = { { "test string" } };
+ public static char sb0, sb1, sb2, sb3, sb4, sb5, sb6;
+ public static String f(ref String arg)
+ {
+ return arg;
+ }
+ public static Random rand = new Random();
+ public static int Main()
+ {
+ bool passed = true;
+ String str2 = "test string";
+ String[] str1darr = { "string access", "test string" };
+ Char[,] c2darr = { { '0', '1', '2', '3', '4', '5', '6' }, { 'a', 'b', 'c', 'd', 'e', 'f', 'g' } };
+ CL cl1 = new CL();
+ VT vt1;
+ vt1.str = "test string";
+ char b0, b1, b2, b3, b4, b5, b6;
+ //accessing the strings at different indices. assign to local char
+ b0 = str2[0];
+ b1 = str1[0];
+ b2 = cl1.str[0];
+ b3 = vt1.str[0];
+ b4 = str1darr[1][0];
+ b5 = str2darr[0, 0][0];
+ b6 = f(ref str2)[0];
+ if ((b0 != b1) || (b1 != b2) || (b2 != b3) || (b3 != b4) || (b4 != b5) || (b5 != b6))
+ passed = false;
+ if ((str2[4] != str1[4]) || (str1[4] != cl1.str[4]) || (cl1.str[4] != vt1.str[4]) || (vt1.str[4] != str1darr[1][4]) || (str1darr[1][4] != str2darr[0, 0][4]) || (str2darr[0, 0][4] != f(ref str2)[4]))
+ passed = false;
+ b0 = str2[10];
+ b1 = str1[10];
+ b2 = cl1.str[10];
+ b3 = vt1.str[10];
+ b4 = str1darr[1][10];
+ b5 = str2darr[0, 0][10];
+ b6 = f(ref str2)[10];
+ if ((b0 != b1) || (b1 != b2) || (b2 != b3) || (b3 != b4) || (b4 != b5) || (b5 != b6))
+ passed = false;
+ int j = rand.Next(0, 10);
+ b0 = str2[j];
+ b1 = str1[j];
+ b2 = cl1.str[j];
+ b3 = vt1.str[j];
+ b4 = str1darr[1][j];
+ b5 = str2darr[0, 0][j];
+ b6 = f(ref str2)[j];
+ if ((b0 != b1) || (b1 != b2) || (b2 != b3) || (b3 != b4) || (b4 != b5) || (b5 != b6))
+ passed = false;
+
+ //accessing the strings at different indices, assign to static char
+ sb0 = str2[1];
+ sb1 = str1[1];
+ sb2 = cl1.str[1];
+ sb3 = vt1.str[1];
+ sb4 = str1darr[1][1];
+ sb5 = str2darr[0, 0][1];
+ sb6 = f(ref str2)[1];
+ if ((sb0 != sb1) || (sb1 != sb2) || (sb2 != sb3) || (sb3 != sb4) || (sb4 != sb5) || (sb5 != sb6))
+ passed = false;
+ if ((str2[5] != str1[5]) || (str1[5] != cl1.str[5]) || (cl1.str[5] != vt1.str[5]) || (vt1.str[5] != str1darr[1][5]) || (str1darr[1][5] != str2darr[0, 0][5]) || (str2darr[0, 0][5] != f(ref str2)[5]))
+ passed = false;
+ sb0 = str2[9];
+ sb1 = str1[9];
+ sb2 = cl1.str[9];
+ sb3 = vt1.str[9];
+ sb4 = str1darr[1][9];
+ sb5 = str2darr[0, 0][9];
+ sb6 = f(ref str2)[9];
+ if ((sb0 != sb1) || (sb1 != sb2) || (sb2 != sb3) || (sb3 != sb4) || (sb4 != sb5) || (sb5 != sb6))
+ passed = false;
+ j = rand.Next(0, 10);
+ sb0 = str2[j];
+ sb1 = str1[j];
+ sb2 = cl1.str[j];
+ sb3 = vt1.str[j];
+ sb4 = str1darr[1][j];
+ sb5 = str2darr[0, 0][j];
+ sb6 = f(ref str2)[j];
+ if ((sb0 != sb1) || (sb1 != sb2) || (sb2 != sb3) || (sb3 != sb4) || (sb4 != sb5) || (sb5 != sb6))
+ passed = false;
+
+ //accessing the strings at different indices, assign to VT char
+ vt1.b0 = str2[2];
+ vt1.b1 = str1[2];
+ vt1.b2 = cl1.str[2];
+ vt1.b3 = vt1.str[2];
+ vt1.b4 = str1darr[1][2];
+ vt1.b5 = str2darr[0, 0][2];
+ vt1.b6 = f(ref str2)[2];
+ if ((vt1.b0 != vt1.b1) || (vt1.b1 != vt1.b2) || (vt1.b2 != vt1.b3) || (vt1.b3 != vt1.b4) || (vt1.b4 != vt1.b5) || (vt1.b5 != vt1.b6))
+ passed = false;
+ if ((str2[6] != str1[6]) || (str1[6] != cl1.str[6]) || (cl1.str[6] != vt1.str[6]) || (vt1.str[6] != str1darr[1][6]) || (str1darr[1][6] != str2darr[0, 0][6]) || (str2darr[0, 0][6] != f(ref str2)[6]))
+ passed = false;
+ vt1.b0 = str2[8];
+ vt1.b1 = str1[8];
+ vt1.b2 = cl1.str[8];
+ vt1.b3 = vt1.str[8];
+ vt1.b4 = str1darr[1][8];
+ vt1.b5 = str2darr[0, 0][8];
+ vt1.b6 = f(ref str2)[8];
+ if ((vt1.b0 != vt1.b1) || (vt1.b1 != vt1.b2) || (vt1.b2 != vt1.b3) || (vt1.b3 != vt1.b4) || (vt1.b4 != vt1.b5) || (vt1.b5 != vt1.b6))
+ passed = false;
+ j = rand.Next(0, 10);
+ vt1.b0 = str2[j];
+ vt1.b1 = str1[j];
+ vt1.b2 = cl1.str[j];
+ vt1.b3 = vt1.str[j];
+ vt1.b4 = str1darr[1][j];
+ vt1.b5 = str2darr[0, 0][j];
+ vt1.b6 = f(ref str2)[j];
+ if ((vt1.b0 != vt1.b1) || (vt1.b1 != vt1.b2) || (vt1.b2 != vt1.b3) || (vt1.b3 != vt1.b4) || (vt1.b4 != vt1.b5) || (vt1.b5 != vt1.b6))
+ passed = false;
+
+ //accessing the strings at different indices, assign to CL char
+ cl1.b0 = str2[7];
+ cl1.b1 = str1[7];
+ cl1.b2 = cl1.str[7];
+ cl1.b3 = vt1.str[7];
+ cl1.b4 = str1darr[1][7];
+ cl1.b5 = str2darr[0, 0][7];
+ cl1.b6 = f(ref str2)[7];
+ if ((cl1.b0 != cl1.b1) || (cl1.b1 != cl1.b2) || (cl1.b2 != cl1.b3) || (cl1.b3 != cl1.b4) || (cl1.b4 != cl1.b5) || (cl1.b5 != cl1.b6))
+ passed = false;
+ if ((str2[0] != str1[0]) || (str1[0] != cl1.str[0]) || (cl1.str[0] != vt1.str[0]) || (vt1.str[0] != str1darr[1][0]) || (str1darr[1][0] != str2darr[0, 0][0]) || (str2darr[0, 0][0] != f(ref str2)[0]))
+ passed = false;
+ cl1.b0 = str2[4];
+ cl1.b1 = str1[4];
+ cl1.b2 = cl1.str[4];
+ cl1.b3 = vt1.str[4];
+ cl1.b4 = str1darr[1][4];
+ cl1.b5 = str2darr[0, 0][4];
+ cl1.b6 = f(ref str2)[4];
+ if ((cl1.b0 != cl1.b1) || (cl1.b1 != cl1.b2) || (cl1.b2 != cl1.b3) || (cl1.b3 != cl1.b4) || (cl1.b4 != cl1.b5) || (cl1.b5 != cl1.b6))
+ passed = false;
+ j = rand.Next(0, 10);
+ cl1.b0 = str2[j];
+ cl1.b1 = str1[j];
+ cl1.b2 = cl1.str[j];
+ cl1.b3 = vt1.str[j];
+ cl1.b4 = str1darr[1][j];
+ cl1.b5 = str2darr[0, 0][j];
+ cl1.b6 = f(ref str2)[j];
+ if ((cl1.b0 != cl1.b1) || (cl1.b1 != cl1.b2) || (cl1.b2 != cl1.b3) || (cl1.b3 != cl1.b4) || (cl1.b4 != cl1.b5) || (cl1.b5 != cl1.b6))
+ passed = false;
+
+ //accessing the strings at different indices, assign to 2d array char
+ c2darr[1, 0] = str2[6];
+ c2darr[1, 1] = str1[6];
+ c2darr[1, 2] = cl1.str[6];
+ c2darr[1, 3] = vt1.str[6];
+ c2darr[1, 4] = str1darr[1][6];
+ c2darr[1, 5] = str2darr[0, 0][6];
+ c2darr[1, 6] = f(ref str2)[6];
+ if ((c2darr[1, 0] != c2darr[1, 1]) || (c2darr[1, 1] != c2darr[1, 2]) || (c2darr[1, 2] != c2darr[1, 3]) || (c2darr[1, 3] != c2darr[1, 4]) || (c2darr[1, 4] != c2darr[1, 5]) || (c2darr[1, 5] != c2darr[1, 6]))
+ passed = false;
+ if ((str2[0] != str1[0]) || (str1[0] != cl1.str[0]) || (cl1.str[0] != vt1.str[0]) || (vt1.str[0] != str1darr[1][0]) || (str1darr[1][0] != str2darr[0, 0][0]) || (str2darr[0, 0][0] != f(ref str2)[0]))
+ passed = false;
+ c2darr[1, 0] = str2[6];
+ c2darr[1, 1] = str1[6];
+ c2darr[1, 2] = cl1.str[6];
+ c2darr[1, 3] = vt1.str[6];
+ c2darr[1, 4] = str1darr[1][6];
+ c2darr[1, 5] = str2darr[0, 0][6];
+ c2darr[1, 6] = f(ref str2)[6];
+ if ((c2darr[1, 0] != c2darr[1, 1]) || (c2darr[1, 1] != c2darr[1, 2]) || (c2darr[1, 2] != c2darr[1, 3]) || (c2darr[1, 3] != c2darr[1, 4]) || (c2darr[1, 4] != c2darr[1, 5]) || (c2darr[1, 5] != c2darr[1, 6]))
+ passed = false;
+ j = rand.Next(0, 10);
+ c2darr[1, 0] = str2[j];
+ c2darr[1, 1] = str1[j];
+ c2darr[1, 2] = cl1.str[j];
+ c2darr[1, 3] = vt1.str[j];
+ c2darr[1, 4] = str1darr[1][j];
+ c2darr[1, 5] = str2darr[0, 0][j];
+ c2darr[1, 6] = f(ref str2)[j];
+ if ((c2darr[1, 0] != c2darr[1, 1]) || (c2darr[1, 1] != c2darr[1, 2]) || (c2darr[1, 2] != c2darr[1, 3]) || (c2darr[1, 3] != c2darr[1, 4]) || (c2darr[1, 4] != c2darr[1, 5]) || (c2darr[1, 5] != c2darr[1, 6]))
+ passed = false;
+
+ if (!passed)
+ {
+ Console.WriteLine("FAILED");
+ return 1;
+ }
+ else
+ {
+ Console.WriteLine("PASSED");
+ return 100;
+ }
+ }
+}
+
+
+
+
diff --git a/tests/src/JIT/Directed/StrAccess/straccess2.cs b/tests/src/JIT/Directed/StrAccess/straccess2.cs
new file mode 100644
index 0000000000..5fb54d99e5
--- /dev/null
+++ b/tests/src/JIT/Directed/StrAccess/straccess2.cs
@@ -0,0 +1,233 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+//
+
+//Similar to StrAccess1, but instead of using constants, different expression is used as the index to access the string
+
+using System;
+
+internal struct VT
+{
+ public String str;
+ public char b0, b1, b2, b3, b4, b5, b6;
+ public int i;
+ public int[][] idxja;
+}
+
+internal class CL
+{
+ public String str = "test string";
+ public char b0, b1, b2, b3, b4, b5, b6;
+ public static int i = 10;
+ public int[,] idx2darr = { { 5, 6 } };
+}
+
+internal unsafe class StrAccess2
+{
+ public static String str1 = "test string";
+ public static int idx1 = 2;
+ public static String[,] str2darr = { { "test string" } };
+ public static int[,,] idx3darr = { { { 8 } } };
+ public static char sb0, sb1, sb2, sb3, sb4, sb5, sb6;
+ public static String f(ref String arg)
+ {
+ return arg;
+ }
+ public static int f1(ref int arg)
+ {
+ return arg;
+ }
+ public static Random rand = new Random();
+ public static int Main()
+ {
+ bool passed = true;
+ int* p = stackalloc int[11];
+ for (int m = 0; m < 11; m++) p[m] = m;
+ String str2 = "test string";
+ String[] str1darr = { "string access", "test string" };
+ Char[,] c2darr = { { '0', '1', '2', '3', '4', '5', '6' }, { 'a', 'b', 'c', 'd', 'e', 'f', 'g' } };
+ CL cl1 = new CL();
+ VT vt1;
+ vt1.i = 0;
+ vt1.str = "test string";
+ vt1.idxja = new int[2][];
+ vt1.idxja[1] = new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
+ int idx2 = 4;
+ int[] idx1darr = { 3, 9, 4, 2, 6, 1, 8, 10, 5, 7, 0 };
+ char b0, b1, b2, b3, b4, b5, b6;
+ //accessing the strings at different indices. assign to local char
+ b0 = str2[vt1.i];
+ b1 = str1[vt1.i];
+ b2 = cl1.str[vt1.i];
+ b3 = vt1.str[vt1.i];
+ b4 = str1darr[1][vt1.i];
+ b5 = str2darr[0, 0][vt1.i];
+ b6 = f(ref str2)[vt1.i];
+ if ((b0 != b1) || (b1 != b2) || (b2 != b3) || (b3 != b4) || (b4 != b5) || (b5 != b6))
+ passed = false;
+ if ((str2[idx2] != str1[idx2]) || (str1[idx2] != cl1.str[idx2]) || (cl1.str[idx2] != vt1.str[idx2]) || (vt1.str[idx2] != str1darr[1][idx2]) || (str1darr[1][idx2] != str2darr[0, 0][idx2]) || (str2darr[0, 0][idx2] != f(ref str2)[idx2]))
+ passed = false;
+ b0 = str2[CL.i];
+ b1 = str1[CL.i];
+ b2 = cl1.str[CL.i];
+ b3 = vt1.str[CL.i];
+ b4 = str1darr[1][CL.i];
+ b5 = str2darr[0, 0][CL.i];
+ b6 = f(ref str2)[CL.i];
+ if ((b0 != b1) || (b1 != b2) || (b2 != b3) || (b3 != b4) || (b4 != b5) || (b5 != b6))
+ passed = false;
+ int j = rand.Next(0, 10);
+ b0 = str2[idx1darr[j]];
+ b1 = str1[idx1darr[j]];
+ b2 = cl1.str[idx1darr[j]];
+ b3 = vt1.str[idx1darr[j]];
+ b4 = str1darr[1][idx1darr[j]];
+ b5 = str2darr[0, 0][idx1darr[j]];
+ b6 = f(ref str2)[idx1darr[j]];
+ if ((b0 != b1) || (b1 != b2) || (b2 != b3) || (b3 != b4) || (b4 != b5) || (b5 != b6))
+ passed = false;
+
+ //accessing the strings at different indices, assign to static char
+ sb0 = str2[idx1 - 1];
+ sb1 = str1[idx1 - 1];
+ sb2 = cl1.str[idx1 - 1];
+ sb3 = vt1.str[idx1 - 1];
+ sb4 = str1darr[idx1 - 1][idx1 - 1];
+ sb5 = str2darr[0, 0][idx1 - 1];
+ sb6 = f(ref str2)[idx1 - 1];
+ if ((sb0 != sb1) || (sb1 != sb2) || (sb2 != sb3) || (sb3 != sb4) || (sb4 != sb5) || (sb5 != sb6) || (sb6 != str2[1]))
+ passed = false;
+ if ((str2[5] != str1[5]) || (str1[5] != cl1.str[5]) || (cl1.str[5] != vt1.str[5]) || (vt1.str[5] != str1darr[1][5]) || (str1darr[1][5] != str2darr[0, 0][5]) || (str2darr[0, 0][5] != f(ref str2)[5]))
+ passed = false;
+ sb0 = str2[idx3darr[0, 0, 0] + 1];
+ sb1 = str1[idx3darr[0, 0, 0] + 1];
+ sb2 = cl1.str[idx3darr[0, 0, 0] + 1];
+ sb3 = vt1.str[idx3darr[0, 0, 0] + 1];
+ sb4 = str1darr[1][idx3darr[0, 0, 0] + 1];
+ sb5 = str2darr[0, 0][idx3darr[0, 0, 0] + 1];
+ sb6 = f(ref str2)[idx3darr[0, 0, 0] + 1];
+ if ((sb0 != sb1) || (sb1 != sb2) || (sb2 != sb3) || (sb3 != sb4) || (sb4 != sb5) || (sb5 != sb6))
+ passed = false;
+ j = rand.Next(0, 10);
+ sb0 = str2[vt1.idxja[1][j]];
+ sb1 = str1[vt1.idxja[1][j]];
+ sb2 = cl1.str[vt1.idxja[1][j]];
+ sb3 = vt1.str[vt1.idxja[1][j]];
+ sb4 = str1darr[1][vt1.idxja[1][j]];
+ sb5 = str2darr[0, 0][vt1.idxja[1][j]];
+ sb6 = f(ref str2)[vt1.idxja[1][j]];
+ if ((sb0 != sb1) || (sb1 != sb2) || (sb2 != sb3) || (sb3 != sb4) || (sb4 != sb5) || (sb5 != sb6))
+ passed = false;
+
+ //accessing the strings at different indices, assign to VT char
+ vt1.b0 = str2[idx2 - idx1];
+ vt1.b1 = str1[idx2 - idx1];
+ vt1.b2 = cl1.str[idx2 - idx1];
+ vt1.b3 = vt1.str[idx2 - idx1];
+ vt1.b4 = str1darr[1][idx2 - idx1];
+ vt1.b5 = str2darr[0, 0][idx2 - idx1];
+ vt1.b6 = f(ref str2)[idx2 - idx1];
+ if ((vt1.b0 != vt1.b1) || (vt1.b1 != vt1.b2) || (vt1.b2 != vt1.b3) || (vt1.b3 != vt1.b4) || (vt1.b4 != vt1.b5) || (vt1.b5 != vt1.b6))
+ passed = false;
+ if ((str2[cl1.idx2darr[0, 1]] != str1[cl1.idx2darr[0, 1]]) || (str1[cl1.idx2darr[0, 1]] != cl1.str[cl1.idx2darr[0, 1]]) || (cl1.str[cl1.idx2darr[0, 1]] != vt1.str[cl1.idx2darr[0, 1]]) || (vt1.str[cl1.idx2darr[0, 1]] != str1darr[1][cl1.idx2darr[0, 1]]) || (str1darr[1][cl1.idx2darr[0, 1]] != str2darr[0, 0][cl1.idx2darr[0, 1]]) || (str2darr[0, 0][cl1.idx2darr[0, 1]] != f(ref str2)[cl1.idx2darr[0, 1]]))
+ passed = false;
+ vt1.b0 = str2[idx3darr[0, 0, 0]];
+ vt1.b1 = str1[idx3darr[0, 0, 0]];
+ vt1.b2 = cl1.str[idx3darr[0, 0, 0]];
+ vt1.b3 = vt1.str[idx3darr[0, 0, 0]];
+ vt1.b4 = str1darr[1][idx3darr[0, 0, 0]];
+ vt1.b5 = str2darr[0, 0][idx3darr[0, 0, 0]];
+ vt1.b6 = f(ref str2)[idx3darr[0, 0, 0]];
+ if ((vt1.b0 != vt1.b1) || (vt1.b1 != vt1.b2) || (vt1.b2 != vt1.b3) || (vt1.b3 != vt1.b4) || (vt1.b4 != vt1.b5) || (vt1.b5 != vt1.b6))
+ passed = false;
+ j = rand.Next(0, 10);
+ vt1.b0 = str2[p[j]];
+ vt1.b1 = str1[p[j]];
+ vt1.b2 = cl1.str[p[j]];
+ vt1.b3 = vt1.str[p[j]];
+ vt1.b4 = str1darr[1][p[j]];
+ vt1.b5 = str2darr[0, 0][p[j]];
+ vt1.b6 = f(ref str2)[p[j]];
+ if ((vt1.b0 != vt1.b1) || (vt1.b1 != vt1.b2) || (vt1.b2 != vt1.b3) || (vt1.b3 != vt1.b4) || (vt1.b4 != vt1.b5) || (vt1.b5 != vt1.b6))
+ passed = false;
+
+ //accessing the strings at different indices, assign to CL char
+ cl1.b0 = str2[CL.i % idx1darr[0]];
+ cl1.b1 = str1[CL.i % idx1darr[0]];
+ cl1.b2 = cl1.str[CL.i % idx1darr[0]];
+ cl1.b3 = vt1.str[CL.i % idx1darr[0]];
+ cl1.b4 = str1darr[1][CL.i % idx1darr[0]];
+ cl1.b5 = str2darr[0, 0][CL.i % idx1darr[0]];
+ cl1.b6 = f(ref str2)[CL.i % idx1darr[0]];
+ if ((cl1.b0 != cl1.b1) || (cl1.b1 != cl1.b2) || (cl1.b2 != cl1.b3) || (cl1.b3 != cl1.b4) || (cl1.b4 != cl1.b5) || (cl1.b5 != cl1.b6))
+ passed = false;
+ if ((str2[0] != str1[0]) || (str1[0] != cl1.str[0]) || (cl1.str[0] != vt1.str[0]) || (vt1.str[0] != str1darr[1][0]) || (str1darr[1][0] != str2darr[0, 0][0]) || (str2darr[0, 0][0] != f(ref str2)[0]))
+ passed = false;
+ cl1.b0 = str2[Convert.ToInt32(c2darr[0, 4]) - Convert.ToInt32(c2darr[0, 0])];
+ cl1.b1 = str1[Convert.ToInt32(c2darr[0, 4]) - Convert.ToInt32(c2darr[0, 0])];
+ cl1.b2 = cl1.str[Convert.ToInt32(c2darr[0, 4]) - Convert.ToInt32(c2darr[0, 0])];
+ cl1.b3 = vt1.str[Convert.ToInt32(c2darr[0, 4]) - Convert.ToInt32(c2darr[0, 0])];
+ cl1.b4 = str1darr[1][Convert.ToInt32(c2darr[0, 4]) - Convert.ToInt32(c2darr[0, 0])];
+ cl1.b5 = str2darr[0, 0][Convert.ToInt32(c2darr[0, 4]) - Convert.ToInt32(c2darr[0, 0])];
+ cl1.b6 = f(ref str2)[Convert.ToInt32(c2darr[0, 4]) - Convert.ToInt32(c2darr[0, 0])];
+ if ((cl1.b0 != cl1.b1) || (cl1.b1 != cl1.b2) || (cl1.b2 != cl1.b3) || (cl1.b3 != cl1.b4) || (cl1.b4 != cl1.b5) || (cl1.b5 != cl1.b6) || (cl1.b6 != str1[4]))
+ passed = false;
+ j = rand.Next(0, 10);
+ cl1.b0 = str2[j];
+ cl1.b1 = str1[j];
+ cl1.b2 = cl1.str[j];
+ cl1.b3 = vt1.str[j];
+ cl1.b4 = str1darr[1][j];
+ cl1.b5 = str2darr[0, 0][j];
+ cl1.b6 = f(ref str2)[j];
+ if ((cl1.b0 != cl1.b1) || (cl1.b1 != cl1.b2) || (cl1.b2 != cl1.b3) || (cl1.b3 != cl1.b4) || (cl1.b4 != cl1.b5) || (cl1.b5 != cl1.b6))
+ passed = false;
+
+ //accessing the strings at different indices, assign to 2d array char
+ c2darr[1, 0] = str2[idx1darr[0] * idx1];
+ c2darr[1, 1] = str1[idx1darr[0] * idx1];
+ c2darr[1, 2] = cl1.str[idx1darr[0] * idx1];
+ c2darr[1, 3] = vt1.str[idx1darr[0] * idx1];
+ c2darr[1, 4] = str1darr[1][idx1darr[0] * idx1];
+ c2darr[1, 5] = str2darr[0, 0][idx1darr[0] * idx1];
+ c2darr[1, 6] = f(ref str2)[idx1darr[0] * idx1];
+ if ((c2darr[1, 0] != c2darr[1, 1]) || (c2darr[1, 1] != c2darr[1, 2]) || (c2darr[1, 2] != c2darr[1, 3]) || (c2darr[1, 3] != c2darr[1, 4]) || (c2darr[1, 4] != c2darr[1, 5]) || (c2darr[1, 5] != c2darr[1, 6]) || (str2[6] != c2darr[1, 6]))
+ passed = false;
+ if ((str2[vt1.i] != str1[vt1.i]) || (str1[vt1.i] != cl1.str[vt1.i]) || (cl1.str[vt1.i] != vt1.str[vt1.i]) || (vt1.str[vt1.i] != str1darr[1][vt1.i]) || (str1darr[1][vt1.i] != str2darr[0, 0][vt1.i]) || (str2darr[0, 0][vt1.i] != f(ref str2)[vt1.i]))
+ passed = false;
+ c2darr[1, 0] = str2[idx1darr[1] - idx1darr[0]];
+ c2darr[1, 1] = str1[idx1darr[1] - idx1darr[0]];
+ c2darr[1, 2] = cl1.str[idx1darr[1] - idx1darr[0]];
+ c2darr[1, 3] = vt1.str[idx1darr[1] - idx1darr[0]];
+ c2darr[1, 4] = str1darr[1][idx1darr[1] - idx1darr[0]];
+ c2darr[1, 5] = str2darr[0, 0][idx1darr[1] - idx1darr[0]];
+ c2darr[1, 6] = f(ref str2)[idx1darr[1] - idx1darr[0]];
+ if ((c2darr[1, 0] != c2darr[1, 1]) || (c2darr[1, 1] != c2darr[1, 2]) || (c2darr[1, 2] != c2darr[1, 3]) || (c2darr[1, 3] != c2darr[1, 4]) || (c2darr[1, 4] != c2darr[1, 5]) || (c2darr[1, 5] != c2darr[1, 6]) || (str2[6] != c2darr[1, 6]))
+ passed = false;
+ j = rand.Next(0, 10);
+ c2darr[1, 0] = str2[f1(ref j)];
+ c2darr[1, 1] = str1[f1(ref j)];
+ c2darr[1, 2] = cl1.str[f1(ref j)];
+ c2darr[1, 3] = vt1.str[f1(ref j)];
+ c2darr[1, 4] = str1darr[1][f1(ref j)];
+ c2darr[1, 5] = str2darr[0, 0][f1(ref j)];
+ c2darr[1, 6] = f(ref str2)[f1(ref j)];
+ if ((c2darr[1, 0] != c2darr[1, 1]) || (c2darr[1, 1] != c2darr[1, 2]) || (c2darr[1, 2] != c2darr[1, 3]) || (c2darr[1, 3] != c2darr[1, 4]) || (c2darr[1, 4] != c2darr[1, 5]) || (c2darr[1, 5] != c2darr[1, 6]))
+ passed = false;
+
+ if (!passed)
+ {
+ Console.WriteLine("FAILED");
+ return 1;
+ }
+ else
+ {
+ Console.WriteLine("PASSED");
+ return 100;
+ }
+ }
+}
+
+
+
+
diff --git a/tests/src/JIT/Directed/StrAccess/straccess3.cs b/tests/src/JIT/Directed/StrAccess/straccess3.cs
new file mode 100644
index 0000000000..1498c52bcc
--- /dev/null
+++ b/tests/src/JIT/Directed/StrAccess/straccess3.cs
@@ -0,0 +1,197 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+//
+
+//random length and random content string
+//IndexOutOfRangeException
+
+using System;
+
+internal struct VT
+{
+ public String str;
+}
+
+internal class CL
+{
+ public String str;
+}
+
+internal class StrAccess1
+{
+ public static String str1;
+ public static Random rand = new Random(12345); //this version is deterministic
+
+ private static int randomUnicodeLetterOrDigit()
+ {
+ int c = (char)rand.Next((int)Char.MinValue, (int)Char.MaxValue);
+ while (!Char.IsLetterOrDigit((char)c))
+ c = rand.Next((int)Char.MinValue, (int)Char.MaxValue);
+ return c;
+ }
+
+ private static string randomUnicodeString(int len)
+ {
+ string str = "";
+ while (len-- >= 0)
+ str += "\\u" + randomUnicodeLetterOrDigit().ToString("X4");
+ return str;
+ }
+
+ public static int Main(string[] args)
+ {
+ bool passed;
+
+ string teststr = "";
+ int len = 0;
+
+ if (args.Length != 0)
+ {
+ teststr = args[0];
+ len = teststr.Length;
+ }
+ else
+ {
+ //construct random string with random length
+ len = rand.Next(50);
+ teststr = randomUnicodeString(len);
+ }
+
+ Console.WriteLine("Test string is {0}", teststr);
+
+ String str2 = "";
+ CL cl1 = new CL();
+ VT vt1;
+
+ str1 = str2 = cl1.str = vt1.str = teststr;
+
+ String[] str1darr = new String[len];
+ for (int j = 0; j < len; j++)
+ str1darr[j] = Convert.ToString(teststr[j]);
+
+ char b0, b1, b2, b3, b4;
+ try
+ {
+ passed = false;
+ b0 = cl1.str[len];
+ }
+ catch (IndexOutOfRangeException)
+ {
+ passed = true;
+ }
+ try
+ {
+ passed = false;
+ b1 = str1[len];
+ }
+ catch (IndexOutOfRangeException)
+ {
+ passed = true;
+ }
+ try
+ {
+ passed = false;
+ b2 = str2[len];
+ }
+ catch (IndexOutOfRangeException)
+ {
+ passed = true;
+ }
+ try
+ {
+ passed = false;
+ b3 = vt1.str[len];
+ }
+ catch (IndexOutOfRangeException)
+ {
+ passed = true;
+ }
+ try
+ {
+ passed = false;
+ b4 = Convert.ToChar(str1darr[len]);
+ }
+ catch (IndexOutOfRangeException)
+ {
+ passed = true;
+ }
+
+ try
+ {
+ passed = false;
+ b0 = cl1.str[-1];
+ }
+ catch (IndexOutOfRangeException)
+ {
+ passed = true;
+ }
+ try
+ {
+ passed = false;
+ b1 = str1[-1];
+ }
+ catch (IndexOutOfRangeException)
+ {
+ passed = true;
+ }
+ try
+ {
+ passed = false;
+ b2 = str2[-1];
+ }
+ catch (IndexOutOfRangeException)
+ {
+ passed = true;
+ }
+ try
+ {
+ passed = false;
+ b3 = vt1.str[-1];
+ }
+ catch (IndexOutOfRangeException)
+ {
+ passed = true;
+ }
+ try
+ {
+ passed = false;
+ b4 = Convert.ToChar(str1darr[-1]);
+ }
+ catch (IndexOutOfRangeException)
+ {
+ passed = true;
+ }
+
+ int i;
+ while (len != 0)
+ {
+ i = rand.Next(0, len);
+ b0 = cl1.str[i];
+ b1 = str1[i];
+ b2 = str2[i];
+ b3 = vt1.str[i];
+ b4 = Convert.ToChar(str1darr[i]);
+ if ((b0 != b1) || (b1 != b2) || (b2 != b3) || (b3 != b4))
+ passed = false;
+ len /= 2;
+ }
+
+ Console.WriteLine();
+ if (!passed)
+ {
+ Console.WriteLine("FAILED");
+ Console.WriteLine("Use the following command to repro:");
+ Console.WriteLine("straccess3.exe {0}", teststr);
+ return 1;
+ }
+ else
+ {
+ Console.WriteLine("PASSED");
+ return 100;
+ }
+ }
+}
+
+
+
+
diff --git a/tests/src/JIT/Directed/StrAccess/straccess4.cs b/tests/src/JIT/Directed/StrAccess/straccess4.cs
new file mode 100644
index 0000000000..0974034ad1
--- /dev/null
+++ b/tests/src/JIT/Directed/StrAccess/straccess4.cs
@@ -0,0 +1,197 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+//
+
+//random length and random content string
+//IndexOutOfRangeException
+
+using System;
+
+internal struct VT
+{
+ public String str;
+}
+
+internal class CL
+{
+ public String str;
+}
+
+internal class StrAccess1
+{
+ public static String str1;
+ public static Random rand = new Random();
+
+ private static int randomUnicodeLetterOrDigit()
+ {
+ int c = (char)rand.Next((int)Char.MinValue, (int)Char.MaxValue);
+ while (!Char.IsLetterOrDigit((char)c))
+ c = rand.Next((int)Char.MinValue, (int)Char.MaxValue);
+ return c;
+ }
+
+ private static string randomUnicodeString(int len)
+ {
+ string str = "";
+ while (len-- >= 0)
+ str += "\\u" + randomUnicodeLetterOrDigit().ToString("X4");
+ return str;
+ }
+
+ public static int Main(string[] args)
+ {
+ bool passed;
+
+ string teststr = "";
+ int len = 0;
+
+ if (args.Length != 0)
+ {
+ teststr = args[0];
+ len = teststr.Length;
+ }
+ else
+ {
+ //construct random string with random length
+ len = rand.Next(50);
+ teststr = randomUnicodeString(len);
+ }
+
+ Console.WriteLine("Test string is {0}", teststr);
+
+ String str2 = "";
+ CL cl1 = new CL();
+ VT vt1;
+
+ str1 = str2 = cl1.str = vt1.str = teststr;
+
+ String[] str1darr = new String[len];
+ for (int j = 0; j < len; j++)
+ str1darr[j] = Convert.ToString(teststr[j]);
+
+ char b0, b1, b2, b3, b4;
+ try
+ {
+ passed = false;
+ b0 = cl1.str[len];
+ }
+ catch (IndexOutOfRangeException)
+ {
+ passed = true;
+ }
+ try
+ {
+ passed = false;
+ b1 = str1[len];
+ }
+ catch (IndexOutOfRangeException)
+ {
+ passed = true;
+ }
+ try
+ {
+ passed = false;
+ b2 = str2[len];
+ }
+ catch (IndexOutOfRangeException)
+ {
+ passed = true;
+ }
+ try
+ {
+ passed = false;
+ b3 = vt1.str[len];
+ }
+ catch (IndexOutOfRangeException)
+ {
+ passed = true;
+ }
+ try
+ {
+ passed = false;
+ b4 = Convert.ToChar(str1darr[len]);
+ }
+ catch (IndexOutOfRangeException)
+ {
+ passed = true;
+ }
+
+ try
+ {
+ passed = false;
+ b0 = cl1.str[-1];
+ }
+ catch (IndexOutOfRangeException)
+ {
+ passed = true;
+ }
+ try
+ {
+ passed = false;
+ b1 = str1[-1];
+ }
+ catch (IndexOutOfRangeException)
+ {
+ passed = true;
+ }
+ try
+ {
+ passed = false;
+ b2 = str2[-1];
+ }
+ catch (IndexOutOfRangeException)
+ {
+ passed = true;
+ }
+ try
+ {
+ passed = false;
+ b3 = vt1.str[-1];
+ }
+ catch (IndexOutOfRangeException)
+ {
+ passed = true;
+ }
+ try
+ {
+ passed = false;
+ b4 = Convert.ToChar(str1darr[-1]);
+ }
+ catch (IndexOutOfRangeException)
+ {
+ passed = true;
+ }
+
+ int i;
+ while (len != 0)
+ {
+ i = rand.Next(0, len);
+ b0 = cl1.str[i];
+ b1 = str1[i];
+ b2 = str2[i];
+ b3 = vt1.str[i];
+ b4 = Convert.ToChar(str1darr[i]);
+ if ((b0 != b1) || (b1 != b2) || (b2 != b3) || (b3 != b4))
+ passed = false;
+ len /= 2;
+ }
+
+ Console.WriteLine();
+ if (!passed)
+ {
+ Console.WriteLine("FAILED");
+ Console.WriteLine("Use the following command to repro:");
+ Console.WriteLine("straccess3.exe {0}", teststr);
+ return 1;
+ }
+ else
+ {
+ Console.WriteLine("PASSED");
+ return 100;
+ }
+ }
+}
+
+
+
+
diff --git a/tests/src/JIT/Directed/UnrollLoop/Dev10_846218.cs b/tests/src/JIT/Directed/UnrollLoop/Dev10_846218.cs
new file mode 100644
index 0000000000..32c8418928
--- /dev/null
+++ b/tests/src/JIT/Directed/UnrollLoop/Dev10_846218.cs
@@ -0,0 +1,63 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Runtime.CompilerServices;
+
+namespace Test
+{
+ internal struct IntVec
+ {
+ public int x;
+ public int y;
+ }
+
+ internal interface IDoSomething
+ {
+ void Do(IntVec o);
+ }
+
+ internal class DoSomething : IDoSomething
+ {
+ public string output = "";
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ public void Do(IntVec o)
+ {
+ output = output + o.x.ToString() + " " + o.y.ToString() + ",";
+ }
+ }
+
+ internal class Program
+ {
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ private static void Test(IDoSomething oDoesSomething)
+ {
+ IntVec oVec = new IntVec();
+ for (oVec.x = 0; oVec.x < 2; oVec.x++)
+ {
+ for (oVec.y = 0; oVec.y < 2; oVec.y++)
+ {
+ oDoesSomething.Do(oVec);
+ }
+ }
+ }
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ private static int Main(string[] args)
+ {
+ DoSomething doSomething = new DoSomething();
+ Test(doSomething);
+ if (doSomething.output == "0 0,0 1,1 0,1 1,")
+ {
+ Console.WriteLine("PASS");
+ return 100;
+ }
+ Console.WriteLine("Expected :{0} but found :{1}", "0 0,0 1,1 0,1 1,", doSomething.output);
+ return 101;
+ }
+ }
+}
+
diff --git a/tests/src/JIT/Directed/UnrollLoop/UnrollLoop.csproj b/tests/src/JIT/Directed/UnrollLoop/UnrollLoop.csproj
new file mode 100644
index 0000000000..33b2928ebc
--- /dev/null
+++ b/tests/src/JIT/Directed/UnrollLoop/UnrollLoop.csproj
@@ -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>
diff --git a/tests/src/JIT/Directed/UnrollLoop/app.config b/tests/src/JIT/Directed/UnrollLoop/app.config
new file mode 100644
index 0000000000..62803f5972
--- /dev/null
+++ b/tests/src/JIT/Directed/UnrollLoop/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> \ No newline at end of file
diff --git a/tests/src/JIT/Directed/UnrollLoop/cs_template.proj b/tests/src/JIT/Directed/UnrollLoop/cs_template.proj
new file mode 100644
index 0000000000..adc2f21e14
--- /dev/null
+++ b/tests/src/JIT/Directed/UnrollLoop/cs_template.proj
@@ -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>
diff --git a/tests/src/JIT/Directed/UnrollLoop/loop1.cs b/tests/src/JIT/Directed/UnrollLoop/loop1.cs
new file mode 100644
index 0000000000..5ceedc843e
--- /dev/null
+++ b/tests/src/JIT/Directed/UnrollLoop/loop1.cs
@@ -0,0 +1,251 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+//
+
+using System;
+namespace A
+{
+ internal class B
+ {
+ public static int downBy1ge(int amount)
+ {
+ int i;
+ int sum = 0;
+ for (i = 8; i >= 1; i -= 1)
+ {
+ sum += amount;
+ }
+ return sum + i;
+ }
+
+ public static int downBy2ne(int amount)
+ {
+ int i;
+ int sum = 0;
+ for (i = 9; i != 1; i -= 2)
+ {
+ sum += amount;
+ }
+ return sum + i;
+ }
+
+ public static int upBy1le(int amount)
+ {
+ int i;
+ int sum = 0;
+ for (i = 1; i <= 8; i += 1)
+ {
+ sum += amount;
+ }
+ return sum + i;
+ }
+
+ public static int upBy1lt(int amount)
+ {
+ int i;
+ int sum = 0;
+ for (i = 1; i < 8; i += 1)
+ {
+ sum += amount;
+ }
+ return sum + i;
+ }
+
+ public static int downBy1gt(int amount)
+ {
+ int i;
+ int sum = 0;
+ for (i = 9; i > 2; i -= 1)
+ {
+ sum += amount;
+ }
+ return sum + i;
+ }
+
+ public static int upBy2le(int amount)
+ {
+ int i;
+ int sum = 0;
+ for (i = 1; i <= 9; i += 2)
+ {
+ sum += amount;
+ }
+ return sum + i;
+ }
+
+ public static int downBy2ge(int amount)
+ {
+ int i;
+ int sum = 0;
+ for (i = 9; i >= 1; i -= 2)
+ {
+ sum += amount;
+ }
+ return sum + i;
+ }
+
+ public static int upBy2lt(int amount)
+ {
+ int i;
+ int sum = 0;
+ for (i = 1; i < 9; i += 2)
+ {
+ sum += amount;
+ }
+ return sum + i;
+ }
+
+ public static int downBy2gt(int amount)
+ {
+ int i;
+ int sum = 0;
+ for (i = 10; i > 2; i -= 2)
+ {
+ sum += amount;
+ }
+ return sum + i;
+ }
+
+ public static int upBy1ne(int amount)
+ {
+ int i;
+ int sum = 0;
+ for (i = 1; i != 8; i += 1)
+ {
+ sum += amount;
+ }
+ return sum + i;
+ }
+
+ public static int downBy1ne(int amount)
+ {
+ int i;
+ int sum = 0;
+ for (i = 9; i != 2; i -= 1)
+ {
+ sum += amount;
+ }
+ return sum + i;
+ }
+
+ public static int upBy2ne(int amount)
+ {
+ int i;
+ int sum = 0;
+ for (i = 1; i != 9; i += 2)
+ {
+ sum += amount;
+ }
+ return sum + i;
+ }
+
+ public static int upBy3neWrap(int amount)
+ {
+ short i;
+ int sum = 0;
+ for (i = 1; i != 8; i += 3)
+ {
+ sum += amount;
+ }
+ return sum + i;
+ }
+
+ public static int downBy3neWrap(int amount)
+ {
+ short i;
+ int sum = 0;
+ for (i = 8; i != 1; i -= 3)
+ {
+ sum += amount;
+ }
+ return sum + i;
+ }
+
+ public static int Main(String[] args)
+ {
+ bool failed = false;
+
+ if (upBy1le(10) != 89)
+ {
+ Console.WriteLine("upBy1le failed");
+ failed = true;
+ }
+ if (downBy1ge(10) != 80)
+ {
+ Console.WriteLine("downBy1ge failed");
+ failed = true;
+ }
+ if (upBy1lt(10) != 78)
+ {
+ Console.WriteLine("upBy1lt failed");
+ failed = true;
+ }
+ if (downBy1gt(10) != 72)
+ {
+ Console.WriteLine("downBy1gt failed");
+ failed = true;
+ }
+ if (upBy2le(10) != 61)
+ {
+ Console.WriteLine("upBy2le failed");
+ failed = true;
+ }
+ if (downBy2ge(10) != 49)
+ {
+ Console.WriteLine("downBy2ge failed");
+ failed = true;
+ }
+ if (upBy2lt(10) != 49)
+ {
+ Console.WriteLine("upBy2lt failed");
+ failed = true;
+ }
+ if (downBy2gt(10) != 42)
+ {
+ Console.WriteLine("downBy2gt failed");
+ failed = true;
+ }
+ if (upBy1ne(10) != 78)
+ {
+ Console.WriteLine("upBy1ne failed");
+ failed = true;
+ }
+ if (downBy1ne(10) != 72)
+ {
+ Console.WriteLine("downBy1ne failed");
+ failed = true;
+ }
+ if (upBy2ne(10) != 49)
+ {
+ Console.WriteLine("upBy2ne failed");
+ failed = true;
+ }
+ if (downBy2ne(10) != 41)
+ {
+ Console.WriteLine("downBy2ne failed");
+ failed = true;
+ }
+ if (upBy3neWrap(1) != 43701)
+ {
+ Console.WriteLine("upBy3neWrap failed");
+ failed = true;
+ }
+ if (downBy3neWrap(1) != 43694)
+ {
+ Console.WriteLine("downBy3neWrap failed");
+ failed = true;
+ }
+ if (!failed)
+ {
+ Console.WriteLine("Passed");
+ return 100;
+ }
+ else
+ {
+ Console.WriteLine("Failed");
+ return 1;
+ }
+ }
+ }
+}
+
diff --git a/tests/src/JIT/Directed/UnrollLoop/loop4.cs b/tests/src/JIT/Directed/UnrollLoop/loop4.cs
new file mode 100644
index 0000000000..854c8fb790
--- /dev/null
+++ b/tests/src/JIT/Directed/UnrollLoop/loop4.cs
@@ -0,0 +1,424 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+//
+
+//Testing small for loops (less than 5)
+
+using System;
+
+internal class SmallLoop1
+{
+ public static int Main()
+ {
+ bool passed = true;
+ int j;
+
+ //i++
+ j = 2;
+ for (int i = 0; i == 4; i++) j++;
+ if (j != 2)
+ {
+ Console.WriteLine("testcase 1.1 failed");
+ Console.WriteLine("j is {0}", j);
+ passed = false;
+ }
+ j = 2;
+ for (int i = 1; i < 5; i++) j++;
+ if (j != 6)
+ {
+ Console.WriteLine("testcase 1.2 failed");
+ Console.WriteLine("j is {0}", j);
+ passed = false;
+ }
+ j = 2;
+ for (int i = 2; i <= 6; i++) j++;
+ if (j != 7)
+ {
+ Console.WriteLine("testcase 1.3 failed");
+ Console.WriteLine("j is {0}", j);
+ passed = false;
+ }
+ j = 2;
+ for (int i = 3; -i > -7; i++) j++;
+ if (j != 6)
+ {
+ Console.WriteLine("testcase 1.4 failed");
+ Console.WriteLine("j is {0}", j);
+ passed = false;
+ }
+ j = 2;
+ for (int i = 4; -i >= -8; i++) j++;
+ if (j != 7)
+ {
+ Console.WriteLine("testcase 1.5 failed");
+ Console.WriteLine("j is {0}", j);
+ passed = false;
+ }
+ j = 2;
+ for (int i = 5; j != 6; i++) j++;
+ if (j != 6)
+ {
+ Console.WriteLine("testcase 1.6 failed");
+ Console.WriteLine("j is {0}", j);
+ passed = false;
+ }
+ //i+=1
+ j = 2;
+ for (int i = 0; i == 4; i += 1) j++;
+ if (j != 2)
+ {
+ Console.WriteLine("testcase 2.1 failed");
+ Console.WriteLine("j is {0}", j);
+ passed = false;
+ }
+ j = 2;
+ for (int i = 6; i < 10; i += 1) j++;
+ if (j != 6)
+ {
+ Console.WriteLine("testcase 2.2 failed");
+ Console.WriteLine("j is {0}", j);
+ passed = false;
+ }
+ j = 2;
+ for (int i = 7; i <= 11; i += 1) j++;
+ if (j != 7)
+ {
+ Console.WriteLine("testcase 2.3 failed");
+ Console.WriteLine("j is {0}", j);
+ passed = false;
+ }
+ j = 2;
+ for (int i = 8; -i > -12; i += 1) j++;
+ if (j != 6)
+ {
+ Console.WriteLine("testcase 2.4 failed");
+ Console.WriteLine("j is {0}", j);
+ passed = false;
+ }
+ j = 2;
+ for (int i = 9; -i >= -13; i += 1) j++;
+ if (j != 7)
+ {
+ Console.WriteLine("testcase 2.5 failed");
+ Console.WriteLine("j is {0}", j);
+ passed = false;
+ }
+ j = 2;
+ for (int i = 10; j != 6; i += 1) j++;
+ if (j != 6)
+ {
+ Console.WriteLine("testcase 2.6 failed");
+ Console.WriteLine("j is {0}", j);
+ passed = false;
+ }
+ //i--
+ j = 2;
+ for (int i = 4; i == 0; i--) j++;
+ if (j != 2)
+ {
+ Console.WriteLine("testcase 3.1 failed");
+ Console.WriteLine("j is {0}", j);
+ passed = false;
+ }
+ j = 2;
+ for (int i = 16; -i < -12; i--) j++;
+ if (j != 6)
+ {
+ Console.WriteLine("testcase 3.2 failed");
+ Console.WriteLine("j is {0}", j);
+ passed = false;
+ }
+ j = 2;
+ for (int i = 15; -i <= -11; i--) j++;
+ if (j != 7)
+ {
+ Console.WriteLine("testcase 3.3 failed");
+ Console.WriteLine("j is {0}", j);
+ passed = false;
+ }
+ j = 2;
+ for (int i = 14; i > 10; i--) j++;
+ if (j != 6)
+ {
+ Console.WriteLine("testcase 3.4 failed");
+ Console.WriteLine("j is {0}", j);
+ passed = false;
+ }
+ j = 2;
+ for (int i = 13; i >= 9; i--) j++;
+ if (j != 7)
+ {
+ Console.WriteLine("testcase 3.5 failed");
+ Console.WriteLine("j is {0}", j);
+ passed = false;
+ }
+ j = 2;
+ for (int i = 12; j != 8; i--) j++;
+ if (j != 8)
+ {
+ Console.WriteLine("testcase 3.6 failed");
+ Console.WriteLine("j is {0}", j);
+ passed = false;
+ }
+ //i-=1
+ j = 2;
+ for (int i = 1; i == 0; i -= 1) j++;
+ if (j != 2)
+ {
+ Console.WriteLine("testcase 4.1 failed");
+ Console.WriteLine("j is {0}", j);
+ passed = false;
+ }
+ j = 2;
+ for (int i = 2; -i < -2; i -= 1) j++;
+ if (j != 2)
+ {
+ Console.WriteLine("testcase 4.2 failed");
+ Console.WriteLine("j is {0}", j);
+ passed = false;
+ }
+ j = 2;
+ for (int i = 3; -i <= -1; i -= 1) j++;
+ if (j != 5)
+ {
+ Console.WriteLine("testcase 4.3 failed");
+ Console.WriteLine("j is {0}", j);
+ passed = false;
+ }
+ j = 2;
+ for (int i = 4; i > 0; i -= 1) j++;
+ if (j != 6)
+ {
+ Console.WriteLine("testcase 4.4 failed");
+ Console.WriteLine("j is {0}", j);
+ passed = false;
+ }
+ j = 2;
+ for (int i = 5; i >= 1; i -= 1) j++;
+ if (j != 7)
+ {
+ Console.WriteLine("testcase 4.5 failed");
+ Console.WriteLine("j is {0}", j);
+ passed = false;
+ }
+ j = 2;
+ for (int i = 6; j != 6; i -= 1) j++;
+ if (j != 6)
+ {
+ Console.WriteLine("testcase 4.6 failed");
+ Console.WriteLine("j is {0}", j);
+ passed = false;
+ }
+ //i*=2
+ j = 2;
+ for (int i = 0; i == 4; i *= 2) j++;
+ if (j != 2)
+ {
+ Console.WriteLine("testcase 5.1 failed");
+ Console.WriteLine("j is {0}", j);
+ passed = false;
+ }
+ j = 2;
+ for (int i = 1; i < 8; i *= 2) j++;
+ if (j != 5)
+ {
+ Console.WriteLine("testcase 5.2 failed");
+ Console.WriteLine("j is {0}", j);
+ passed = false;
+ }
+ j = 2;
+ for (int i = 2; i <= 32; i *= 2) j++;
+ if (j != 7)
+ {
+ Console.WriteLine("testcase 5.3 failed");
+ Console.WriteLine("j is {0}", j);
+ passed = false;
+ }
+ j = 2;
+ for (int i = 2; -i > -32; i *= 2) j++;
+ if (j != 6)
+ {
+ Console.WriteLine("testcase 5.4 failed");
+ Console.WriteLine("j is {0}", j);
+ passed = false;
+ }
+ j = 2;
+ for (int i = 1; -i >= -8; i *= 2) j++;
+ if (j != 6)
+ {
+ Console.WriteLine("testcase 5.5 failed");
+ Console.WriteLine("j is {0}", j);
+ passed = false;
+ }
+ j = 2;
+ for (int i = 6; j != 6; i *= 2) j++;
+ if (j != 6)
+ {
+ Console.WriteLine("testcase 5.6 failed");
+ Console.WriteLine("j is {0}", j);
+ passed = false;
+ }
+ //i/=3
+ j = 2;
+ for (int i = 4; i == 4; i /= 3) j++;
+ if (j != 3)
+ {
+ Console.WriteLine("testcase 6.1 failed");
+ Console.WriteLine("j is {0}", j);
+ passed = false;
+ }
+ j = 2;
+ for (int i = 81; -i < -1; i /= 3) j++;
+ if (j != 6)
+ {
+ Console.WriteLine("testcase 6.2 failed");
+ Console.WriteLine("j is {0}", j);
+ passed = false;
+ }
+ j = 2;
+ for (int i = 81; -i <= -1; i /= 3) j++;
+ if (j != 7)
+ {
+ Console.WriteLine("testcase 6.3 failed");
+ Console.WriteLine("j is {0}", j);
+ passed = false;
+ }
+ j = 2;
+ for (int i = 81; i > 1; i /= 3) j++;
+ if (j != 6)
+ {
+ Console.WriteLine("testcase 6.4 failed");
+ Console.WriteLine("j is {0}", j);
+ passed = false;
+ }
+ j = 2;
+ for (int i = 81; i >= 1; i /= 3) j++;
+ if (j != 7)
+ {
+ Console.WriteLine("testcase 6.5 failed");
+ Console.WriteLine("j is {0}", j);
+ passed = false;
+ }
+ j = 2;
+ for (int i = 6; j != 6; i /= 3) j++;
+ if (j != 6)
+ {
+ Console.WriteLine("testcase 6.6 failed");
+ Console.WriteLine("j is {0}", j);
+ passed = false;
+ }
+ //i*=2
+ j = 2;
+ for (int i = 0; i == 4; i <<= 1) j++;
+ if (j != 2)
+ {
+ Console.WriteLine("testcase 7.1 failed");
+ Console.WriteLine("j is {0}", j);
+ passed = false;
+ }
+ j = 2;
+ for (int i = 1; i < 8; i <<= 1) j++;
+ if (j != 5)
+ {
+ Console.WriteLine("testcase 7.2 failed");
+ Console.WriteLine("j is {0}", j);
+ passed = false;
+ }
+ j = 2;
+ for (int i = 2; i <= 32; i <<= 1) j++;
+ if (j != 7)
+ {
+ Console.WriteLine("testcase 7.3 failed");
+ Console.WriteLine("j is {0}", j);
+ passed = false;
+ }
+ j = 2;
+ for (int i = 2; -i > -32; i <<= 1) j++;
+ if (j != 6)
+ {
+ Console.WriteLine("testcase 7.4 failed");
+ Console.WriteLine("j is {0}", j);
+ passed = false;
+ }
+ j = 2;
+ for (int i = 1; -i >= -8; i <<= 1) j++;
+ if (j != 6)
+ {
+ Console.WriteLine("testcase 7.5 failed");
+ Console.WriteLine("j is {0}", j);
+ passed = false;
+ }
+ j = 2;
+ for (int i = 6; j != 6; i <<= 1) j++;
+ if (j != 6)
+ {
+ Console.WriteLine("testcase 7.6 failed");
+ Console.WriteLine("j is {0}", j);
+ passed = false;
+ }
+ //i/=3
+ j = 2;
+ for (int i = 4; i == 4; i >>= 1) j++;
+ if (j != 3)
+ {
+ Console.WriteLine("testcase 8.1 failed");
+ Console.WriteLine("j is {0}", j);
+ passed = false;
+ }
+ j = 2;
+ for (int i = 81; -i < -1; i >>= 1) j++;
+ if (j != 8)
+ {
+ Console.WriteLine("testcase 8.2 failed");
+ Console.WriteLine("j is {0}", j);
+ passed = false;
+ }
+ j = 2;
+ for (int i = 81; -i <= -1; i >>= 1) j++;
+ if (j != 9)
+ {
+ Console.WriteLine("testcase 8.3 failed");
+ Console.WriteLine("j is {0}", j);
+ passed = false;
+ }
+ j = 2;
+ for (int i = 81; i > 1; i >>= 1) j++;
+ if (j != 8)
+ {
+ Console.WriteLine("testcase 8.4 failed");
+ Console.WriteLine("j is {0}", j);
+ passed = false;
+ }
+ j = 2;
+ for (int i = 81; i >= 1; i >>= 1) j++;
+ if (j != 9)
+ {
+ Console.WriteLine("testcase 8.5 failed");
+ Console.WriteLine("j is {0}", j);
+ passed = false;
+ }
+ j = 2;
+ for (int i = 6; j != 6; i >>= 1) j++;
+ if (j != 6)
+ {
+ Console.WriteLine("testcase 8.6 failed");
+ Console.WriteLine("j is {0}", j);
+ passed = false;
+ }
+
+ if (!passed)
+ {
+ Console.WriteLine("FAILED");
+ return 1;
+ }
+ else
+ {
+ Console.WriteLine("PASSED");
+ return 100;
+ }
+ }
+}
+
+
+
+
diff --git a/tests/src/JIT/Directed/UnrollLoop/packages.config b/tests/src/JIT/Directed/UnrollLoop/packages.config
new file mode 100644
index 0000000000..06d3d11ead
--- /dev/null
+++ b/tests/src/JIT/Directed/UnrollLoop/packages.config
@@ -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>
diff --git a/tests/src/JIT/Directed/coverage/flowgraph/app.config b/tests/src/JIT/Directed/coverage/flowgraph/app.config
new file mode 100644
index 0000000000..62803f5972
--- /dev/null
+++ b/tests/src/JIT/Directed/coverage/flowgraph/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> \ No newline at end of file
diff --git a/tests/src/JIT/Directed/coverage/flowgraph/cs_template.proj b/tests/src/JIT/Directed/coverage/flowgraph/cs_template.proj
new file mode 100644
index 0000000000..adc2f21e14
--- /dev/null
+++ b/tests/src/JIT/Directed/coverage/flowgraph/cs_template.proj
@@ -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>
diff --git a/tests/src/JIT/Directed/coverage/flowgraph/flowgraph.csproj b/tests/src/JIT/Directed/coverage/flowgraph/flowgraph.csproj
new file mode 100644
index 0000000000..33b2928ebc
--- /dev/null
+++ b/tests/src/JIT/Directed/coverage/flowgraph/flowgraph.csproj
@@ -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>
diff --git a/tests/src/JIT/Directed/coverage/flowgraph/packages.config b/tests/src/JIT/Directed/coverage/flowgraph/packages.config
new file mode 100644
index 0000000000..06d3d11ead
--- /dev/null
+++ b/tests/src/JIT/Directed/coverage/flowgraph/packages.config
@@ -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>
diff --git a/tests/src/JIT/Directed/coverage/flowgraph/xaddmuly.cs b/tests/src/JIT/Directed/coverage/flowgraph/xaddmuly.cs
new file mode 100644
index 0000000000..d977e1a48a
--- /dev/null
+++ b/tests/src/JIT/Directed/coverage/flowgraph/xaddmuly.cs
@@ -0,0 +1,26 @@
+// 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 Test
+{
+ static public float x = 0x8000;
+ static public float y = 0xF;
+ public static int Main()
+ {
+ x += y * x;
+ x += y * x;
+ Console.WriteLine("x: {0}, y: {1}", x, y);
+ if ((x - 8388608) < 0.01 && (y - 15) < 0.01)
+ {
+ Console.WriteLine("PASSED");
+ return 100;
+ }
+ else
+ {
+ Console.WriteLine("FAILED");
+ return 1;
+ }
+ }
+}
diff --git a/tests/src/JIT/Directed/coverage/oldtests/33objref.cs b/tests/src/JIT/Directed/coverage/oldtests/33objref.cs
new file mode 100644
index 0000000000..f20268ba80
--- /dev/null
+++ b/tests/src/JIT/Directed/coverage/oldtests/33objref.cs
@@ -0,0 +1,184 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+//
+
+//testing more than 32 (>33) objref's on the stack and as function arguments
+
+using System;
+
+internal class ratnl
+{
+ private long _nmr,_dnm;
+ public ratnl(long n, long d)
+ {
+ _nmr = n;
+ _dnm = d;
+ }
+ public static ratnl operator +(ratnl a, ratnl b)
+ {
+ return new ratnl(a._nmr + b._nmr, a._dnm + b._nmr);
+ }
+ public static ratnl operator -(ratnl a, ratnl b)
+ {
+ return new ratnl(a._nmr - b._nmr, a._dnm - b._nmr);
+ }
+ public static ratnl operator *(ratnl a, ratnl b)
+ {
+ return new ratnl(a._nmr * b._nmr, a._dnm * b._nmr);
+ }
+ public long p_nmr
+ {
+ get { return _nmr; }
+ }
+ public long p_dnm
+ {
+ get { return _dnm; }
+ }
+}
+
+internal class Test33objref
+{
+ public static ratnl f1(ratnl a1, ratnl a2, ratnl a3, ratnl a4, ratnl a5, ratnl a6, ratnl a7, ratnl a8, ratnl a9, ratnl a10,
+ ratnl a11, ratnl a12, ratnl a13, ratnl a14, ratnl a15, ratnl a16, ratnl a17, ratnl a18, ratnl a19, ratnl a20,
+ ratnl a21, ratnl a22, ratnl a23, ratnl a24, ratnl a25, ratnl a26, ratnl a27, ratnl a28, ratnl a29, ratnl a30,
+ ratnl a31, ratnl a32, ratnl a33)
+ {
+ ratnl result = ((a1 * a2 + a3 * a4 + a5 * a6 + a7 * a8 + a9 * a10) *
+ (a11 - a12) * (a13 - a14) * (a15 - a16) * (a17 - a18) * (a19 - a20) -
+ a30 - a29 + a28 - a27 + a26 - a25 + a24 - a23 + a22 - a21) *
+ ((a33 - a30) * (a31 + a32));
+ return result;
+ }
+
+ public static long f2(ratnl a1, ratnl a2, ratnl a3, ratnl a4, ratnl a5, ratnl a6, ratnl a7, ratnl a8, ratnl a9, ratnl a10,
+ ratnl a11, ratnl a12, ratnl a13, ratnl a14, ratnl a15, ratnl a16, ratnl a17, ratnl a18, ratnl a19, ratnl a20,
+ ratnl a21, ratnl a22, ratnl a23, ratnl a24, ratnl a25, ratnl a26, ratnl a27, ratnl a28, ratnl a29, ratnl a30,
+ ratnl a31, ratnl a32, ratnl a33)
+ {
+ return ((a1.p_nmr * a2.p_nmr + a3.p_nmr * a4.p_nmr + a5.p_nmr * a6.p_nmr + a7.p_nmr * a8.p_nmr + a9.p_nmr * a10.p_nmr) *
+ (a11.p_nmr - a12.p_nmr) * (a13.p_nmr - a14.p_nmr) * (a15.p_nmr - a16.p_nmr) * (a17.p_nmr - a18.p_nmr) * (a19.p_nmr - a20.p_nmr) -
+ a30.p_nmr - a29.p_nmr + a28.p_nmr - a27.p_nmr + a26.p_nmr - a25.p_nmr + a24.p_nmr - a23.p_nmr + a22.p_nmr - a21.p_nmr) *
+ (a33.p_nmr - a30.p_nmr) * (a31.p_nmr + a32.p_nmr);
+ }
+
+ public static long f3(ratnl a1, ratnl a2, ratnl a3, ratnl a4, ratnl a5, ratnl a6, ratnl a7, ratnl a8, ratnl a9, ratnl a10,
+ ratnl a11, ratnl a12, ratnl a13, ratnl a14, ratnl a15, ratnl a16, ratnl a17, ratnl a18, ratnl a19, ratnl a20,
+ ratnl a21, ratnl a22, ratnl a23, ratnl a24, ratnl a25, ratnl a26, ratnl a27, ratnl a28, ratnl a29, ratnl a30,
+ ratnl a31, ratnl a32, ratnl a33)
+ {
+ return ((a1.p_dnm * a2.p_dnm + a3.p_dnm * a4.p_dnm + a5.p_dnm * a6.p_dnm + a7.p_dnm * a8.p_dnm + a9.p_dnm * a10.p_dnm) *
+ (a11.p_dnm - a12.p_dnm) * (a13.p_dnm - a14.p_dnm) * (a15.p_dnm - a16.p_dnm) * (a17.p_dnm - a18.p_dnm) * (a19.p_dnm - a20.p_dnm) -
+ a30.p_dnm - a29.p_dnm + a28.p_dnm - a27.p_dnm + a26.p_dnm - a25.p_dnm + a24.p_dnm - a23.p_dnm + a22.p_dnm - a21.p_dnm) *
+ (a33.p_dnm - a30.p_dnm) * (a31.p_dnm + a32.p_dnm);
+ }
+
+ public static long f4(ref long a1, ref long a2, ref long a3, ref long a4, ref long a5, ref long a6, ref long a7, ref long a8, ref long a9, ref long a10,
+ ref long a11, ref long a12, ref long a13, ref long a14, ref long a15, ref long a16, ref long a17, ref long a18, ref long a19, ref long a20,
+ ref long a21, ref long a22, ref long a23, ref long a24, ref long a25, ref long a26, ref long a27, ref long a28, ref long a29, ref long a30,
+ ref long a31, ref long a32, ref long a33)
+ {
+ return ((a1 * a2 + a3 * a4 + a5 * a6 + a7 * a8 + a9 * a10) *
+ (a11 - a12) * (a13 - a14) * (a15 - a16) * (a17 - a18) * (a19 - a20) -
+ a30 - a29 + a28 - a27 + a26 - a25 + a24 - a23 + a22 - a21) *
+ (a33 - a30) * (a31 + a32);
+ }
+
+ public static int Main()
+ {
+ bool passed = true;
+
+ ratnl r1 = new ratnl(1, 1);
+ ratnl r2 = new ratnl(2, 2);
+ ratnl r3 = new ratnl(3, 3);
+ ratnl r4 = new ratnl(4, 4);
+ ratnl r5 = new ratnl(5, 5);
+ ratnl r6 = new ratnl(6, 6);
+ ratnl r7 = new ratnl(7, 7);
+ ratnl r8 = new ratnl(8, 8);
+ ratnl r9 = new ratnl(9, 9);
+ ratnl r10 = new ratnl(10, 10);
+ ratnl r11 = new ratnl(-10, 30);
+ ratnl r12 = new ratnl(-9, 31);
+ ratnl r13 = new ratnl(-8, 32);
+ ratnl r14 = new ratnl(-7, 33);
+ ratnl r15 = new ratnl(-6, 34);
+ ratnl r16 = new ratnl(-5, 35);
+ ratnl r17 = new ratnl(-4, 36);
+ ratnl r18 = new ratnl(-3, 37);
+ ratnl r19 = new ratnl(-2, 38);
+ ratnl r20 = new ratnl(-1, 39);
+ ratnl r21 = new ratnl(11, -1);
+ ratnl r22 = new ratnl(22, -2);
+ ratnl r23 = new ratnl(33, -3);
+ ratnl r24 = new ratnl(44, -4);
+ ratnl r25 = new ratnl(55, -5);
+ ratnl r26 = new ratnl(66, -6);
+ ratnl r27 = new ratnl(77, -7);
+ ratnl r28 = new ratnl(88, -8);
+ ratnl r29 = new ratnl(99, -9);
+ ratnl r30 = new ratnl(30, -30);
+ ratnl r31 = new ratnl(31, -31);
+ ratnl r32 = new ratnl(32, -32);
+ ratnl r33 = new ratnl(33, -33);
+
+ if (f1(r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, r15, r16, r17, r18, r19, r20, r21, r22, r23, r24, r25, r26, r27, r28, r29, r30, r31, r32, r33).p_nmr
+ != f2(r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, r15, r16, r17, r18, r19, r20, r21, r22, r23, r24, r25, r26, r27, r28, r29, r30, r31, r32, r33))
+ passed = false;
+
+ long dnm1 = r1.p_dnm;
+ long dnm2 = r2.p_dnm;
+ long dnm3 = r3.p_dnm;
+ long dnm4 = r4.p_dnm;
+ long dnm5 = r5.p_dnm;
+ long dnm6 = r6.p_dnm;
+ long dnm7 = r7.p_dnm;
+ long dnm8 = r8.p_dnm;
+ long dnm9 = r9.p_dnm;
+ long dnm10 = r10.p_dnm;
+ long dnm11 = r11.p_dnm;
+ long dnm12 = r12.p_dnm;
+ long dnm13 = r13.p_dnm;
+ long dnm14 = r14.p_dnm;
+ long dnm15 = r15.p_dnm;
+ long dnm16 = r16.p_dnm;
+ long dnm17 = r17.p_dnm;
+ long dnm18 = r18.p_dnm;
+ long dnm19 = r19.p_dnm;
+ long dnm21 = r21.p_dnm;
+ long dnm20 = r20.p_dnm;
+ long dnm22 = r22.p_dnm;
+ long dnm23 = r23.p_dnm;
+ long dnm24 = r24.p_dnm;
+ long dnm25 = r25.p_dnm;
+ long dnm26 = r26.p_dnm;
+ long dnm27 = r27.p_dnm;
+ long dnm28 = r28.p_dnm;
+ long dnm29 = r29.p_dnm;
+ long dnm30 = r30.p_dnm;
+ long dnm31 = r31.p_dnm;
+ long dnm32 = r32.p_dnm;
+ long dnm33 = r33.p_dnm;
+
+ if (f3(r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, r15, r16, r17, r18, r19, r20, r21, r22, r23, r24, r25, r26, r27, r28, r29, r30, r31, r32, r33)
+ != f4(ref dnm1, ref dnm2, ref dnm3, ref dnm4, ref dnm5, ref dnm6, ref dnm7, ref dnm8, ref dnm9, ref dnm10,
+ ref dnm11, ref dnm12, ref dnm13, ref dnm14, ref dnm15, ref dnm16, ref dnm17, ref dnm18, ref dnm19, ref dnm20,
+ ref dnm21, ref dnm22, ref dnm23, ref dnm24, ref dnm25, ref dnm26, ref dnm27, ref dnm28, ref dnm29, ref dnm30,
+ ref dnm31, ref dnm32, ref dnm33))
+ passed = false;
+
+ if (!passed)
+ {
+ Console.WriteLine("FAILED");
+ return 1;
+ }
+ else
+ {
+ Console.WriteLine("PASSED");
+ return 100;
+ }
+ }
+}
+
+
+
+
diff --git a/tests/src/JIT/Directed/coverage/oldtests/app.config b/tests/src/JIT/Directed/coverage/oldtests/app.config
new file mode 100644
index 0000000000..62803f5972
--- /dev/null
+++ b/tests/src/JIT/Directed/coverage/oldtests/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> \ No newline at end of file
diff --git a/tests/src/JIT/Directed/coverage/oldtests/cs_template.proj b/tests/src/JIT/Directed/coverage/oldtests/cs_template.proj
new file mode 100644
index 0000000000..adc2f21e14
--- /dev/null
+++ b/tests/src/JIT/Directed/coverage/oldtests/cs_template.proj
@@ -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>
diff --git a/tests/src/JIT/Directed/coverage/oldtests/cse1.cs b/tests/src/JIT/Directed/coverage/oldtests/cse1.cs
new file mode 100644
index 0000000000..3e961a38fe
--- /dev/null
+++ b/tests/src/JIT/Directed/coverage/oldtests/cse1.cs
@@ -0,0 +1,171 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+//
+
+//testing common sub-expression elimination
+
+using System;
+public class CL
+{
+ public int item;
+};
+
+public class CSE1
+{
+ private static int s_sa;
+ private static int s_sb;
+ private static int[] s_arr1d = { 10, 20, 30, 40, 50 };
+
+ private static int DoIt(ref int pa)
+ {
+ int result = 0;
+ if (s_sa + s_sb == 0)
+ result++;
+ pa = 1;
+ if (s_sa + s_sb == 1)
+ result++;
+ pa = 2;
+ if (s_sa + s_sb == 2)
+ result++;
+ pa = 3;
+ if (s_sa + s_sb == 3)
+ result++;
+ return result;
+ }
+
+ private static int DoAdd(ref int pa)
+ {
+ int result = 0;
+ if (s_sa + s_sb == 0)
+ result += s_arr1d[s_sa + s_sb];
+ pa = 1;
+ if (s_sa + s_sb == 1)
+ result += s_arr1d[s_sa + s_sb];
+ pa = 2;
+ if (s_sa + s_sb == 2)
+ result += s_arr1d[s_sa + s_sb];
+ pa = 3;
+ if (s_sa + s_sb == 3)
+ result += s_arr1d[s_sa + s_sb];
+ result += s_arr1d[s_sa + s_sb + 1];
+ return result;
+ }
+
+ private static int DoSub(ref int pa)
+ {
+ int result = 0;
+ if (s_sa - s_sb == 3)
+ result += s_arr1d[s_sa - s_sb - 3];
+ pa = 1;
+ if (s_sa - s_sb == 1)
+ result += s_arr1d[s_sa - s_sb];
+ pa = 2;
+ if (s_sa - s_sb == 2)
+ result += s_arr1d[s_sa - s_sb];
+ pa = 3;
+ if (s_sa - s_sb == 3)
+ result += s_arr1d[s_sa - s_sb];
+ result += s_arr1d[s_sa - s_sb + 1];
+ return result;
+ }
+
+ private static int DoMul(ref int pa)
+ {
+ int result = 0;
+ if (s_sa * s_sb == 3)
+ result += s_arr1d[s_sa * s_sb * result];
+ pa = 1;
+ if (s_sa * s_sb == 1)
+ result += s_arr1d[s_sa * s_sb];
+ pa = 2;
+ if (s_sa * s_sb == 2)
+ result += s_arr1d[s_sa * s_sb];
+ pa = 3;
+ if (s_sa * s_sb == 3)
+ result += s_arr1d[s_sa * s_sb];
+ result += s_arr1d[s_sa * s_sb + 1];
+ return result;
+ }
+
+ private static int DoDiv(ref int pa)
+ {
+ int result = 0;
+ if (s_sa / s_sb == 3)
+ result += s_arr1d[s_sa / s_sb];
+ pa = 1;
+ if (s_sa / s_sb == 1)
+ result += s_arr1d[s_sa / s_sb];
+ pa = 2;
+ if (s_sa / s_sb == 2)
+ result += s_arr1d[s_sa / s_sb];
+ pa = 3;
+ if (s_sa / s_sb == 3)
+ result += s_arr1d[s_sa / s_sb - 3];
+ result += s_arr1d[s_sa / s_sb + 1];
+ return result;
+ }
+
+ public static int Main(string[] args)
+ {
+ int result;
+ s_sa = 0;
+ s_sb = 0;
+
+ result = DoIt(ref s_sa);
+ if ((result != 4) || (s_sa != 3))
+ {
+ Console.WriteLine("testcase 0 FAILED, result is {0}, sa is {1}", result, s_sa);
+ return 1;
+ }
+
+ s_sa = 0;
+ result = DoAdd(ref s_sa);
+ if ((result != 150) || (s_sa != 3))
+ {
+ Console.WriteLine("testcase 1 FAILED, result is {0}, sa is {1}", result, s_sa);
+ return 1;
+ }
+
+ result = DoSub(ref s_sa);
+ if ((result != 150) || (s_sa != 3))
+ {
+ Console.WriteLine("testcase 2 FAILED, result is {0}, sa is {1}", result, s_sa);
+ return 1;
+ }
+
+ s_sb = 1;
+ result = DoMul(ref s_sa);
+ if ((result != 150) || (s_sa != 3))
+ {
+ Console.WriteLine("testcase 3 FAILED, result is {0}, sa is {1}", result, s_sa);
+ return 1;
+ }
+
+ result = DoDiv(ref s_sa);
+ if ((result != 150) || (s_sa != 3))
+ {
+ Console.WriteLine("testcase 4 FAILED, result is {0}, sa is {1}", result, s_sa);
+ return 1;
+ }
+
+ CL CL1 = new CL();
+ CL1.item = 10;
+ if (CL1.item * 2 < 30)
+ {
+ CL1.item = CL1.item * 2;
+ }
+ else
+ {
+ CL1.item = 5 * (CL1.item * 2);
+ }
+
+ if (CL1.item * 2 != 40)
+ {
+ Console.WriteLine("testcase 5 FAILED, CL1.item is {0}", CL1.item);
+ return 1;
+ }
+
+ Console.WriteLine("PASSED");
+ return 100;
+ }
+}
diff --git a/tests/src/JIT/Directed/coverage/oldtests/cse2.cs b/tests/src/JIT/Directed/coverage/oldtests/cse2.cs
new file mode 100644
index 0000000000..9e202a4ffe
--- /dev/null
+++ b/tests/src/JIT/Directed/coverage/oldtests/cse2.cs
@@ -0,0 +1,544 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+//
+
+//Testing common sub-expression elimination in random code
+
+using System;
+internal unsafe class testout1
+{
+ public static int sa = 2;
+ public static int sb = 1;
+ public struct VT_0_1_2_5_2
+ {
+ public double a4_0_1_2_5_2;
+ }
+
+
+ public struct VT_0_1_2_5_1
+ {
+ public double a1_0_1_2_5_1;
+ }
+
+
+ public struct VT_0_1_2_4_3
+ {
+ public long a0_0_1_2_4_3;
+ }
+
+
+ public struct VT_0_1_2_4_2
+ {
+ public double a2_0_1_2_4_2;
+ }
+
+
+ public struct VT_0_1_2_3_2
+ {
+ public long a2_0_1_2_3_2;
+ }
+
+
+ public struct VT_0_1_2_3_1
+ {
+ public int a1_0_1_2_3_1;
+ public long a4_0_1_2_3_1;
+ }
+
+
+ public struct VT_0_1_2_2_2
+ {
+ public double a3_0_1_2_2_2;
+ }
+
+
+ public struct VT_0_1_2_2_1
+ {
+ public long a0_0_1_2_2_1;
+ public double a1_0_1_2_2_1;
+ public double a4_0_1_2_2_1;
+ public long a5_0_1_2_2_1;
+ }
+
+
+ public struct VT_0_1_2_1_2
+ {
+ public int a1_0_1_2_1_2;
+ public double a4_0_1_2_1_2;
+ }
+
+
+ public struct VT_0_1_2_1_1
+ {
+ public double a0_0_1_2_1_1;
+ public double a3_0_1_2_1_1;
+ public double a4_0_1_2_1_1;
+ }
+
+
+ public struct VT_0_1_2_5
+ {
+ public double a1_0_1_2_5;
+ public double a2_0_1_2_5;
+ }
+
+
+ public struct VT_0_1_2_3
+ {
+ public int a1_0_1_2_3;
+ public long a2_0_1_2_3;
+ }
+
+
+ public struct VT_0_1_2_2
+ {
+ public double a3_0_1_2_2;
+ }
+
+
+ public struct VT_0_1_2_1
+ {
+ public double a1_0_1_2_1;
+ public double a3_0_1_2_1;
+ }
+
+
+ public struct VT_0_1_2
+ {
+ public double a0_0_1_2;
+ }
+
+
+ public struct VT_0_1
+ {
+ public float a2_0_1;
+ public int a3_0_1;
+ }
+
+
+ public struct VT_0
+ {
+ public float a2_0;
+ public double a3_0;
+ public double a4_0;
+ }
+
+
+ public class CL_0_1_2_5_2
+ {
+ public long a0_0_1_2_5_2 = -sa * sb;
+ }
+
+
+ public class CL_0_1_2_5_1
+ {
+ public double[,,] arr3d_0_1_2_5_1 = new double[5, 11, 4];
+ }
+
+
+ public class CL_0_1_2_4_1
+ {
+ public long[,,] arr3d_0_1_2_4_1 = new long[5, 11, 4];
+ public long a1_0_1_2_4_1 = sa + sb;
+ }
+
+
+ public class CL_0_1_2_3_2
+ {
+ public long[,,] arr3d_0_1_2_3_2 = new long[5, 11, 4];
+ public int[,] arr2d_0_1_2_3_2 = new int[3, 11];
+ }
+
+
+ public class CL_0_1_2_3_1
+ {
+ public long[] arr1d_0_1_2_3_1 = new long[11];
+ public int[,,] arr3d_0_1_2_3_1 = new int[5, 11, 4];
+ public int a5_0_1_2_3_1 = -sa / sb;
+ }
+
+
+ public class CL_0_1_2_2_2
+ {
+ public double a4_0_1_2_2_2 = sa - sb;
+ }
+
+
+ public class CL_0_1_2_2_1
+ {
+ public int[,] arr2d_0_1_2_2_1 = new int[3, 11];
+ }
+
+
+ public class CL_0_1_2_1_2
+ {
+ public double a0_0_1_2_1_2 = sa - sb;
+ }
+
+
+ public class CL_0_1_2_5
+ {
+ public int[,] arr2d_0_1_2_5 = new int[3, 11];
+ }
+
+
+ public class CL_0_1_2_1
+ {
+ public long[,] arr2d_0_1_2_1 = new long[3, 11];
+ }
+
+
+ public class CL_0_1
+ {
+ public double a1_0_1 = sa + sb;
+ }
+
+
+ public static VT_0_1_2_5_2 vtstatic_0_1_2_5_2 = new VT_0_1_2_5_2();
+
+
+
+
+ public static VT_0_1_2_4_3 vtstatic_0_1_2_4_3 = new VT_0_1_2_4_3();
+
+
+
+
+ public static CL_0_1_2_4_1 clstatic_0_1_2_4_1 = new CL_0_1_2_4_1();
+
+
+ public static VT_0_1_2_3_2 vtstatic_0_1_2_3_2 = new VT_0_1_2_3_2();
+
+ private static int s_a2_0_1_2_3_1 = sa / sb;
+
+ public static VT_0_1_2_3_1 vtstatic_0_1_2_3_1 = new VT_0_1_2_3_1();
+
+ private static double s_a1_0_1_2_2_2 = -sa * sb;
+
+
+
+ public static VT_0_1_2_2_1 vtstatic_0_1_2_2_1 = new VT_0_1_2_2_1();
+ public static CL_0_1_2_2_1 clstatic_0_1_2_2_1 = new CL_0_1_2_2_1();
+
+
+
+
+
+
+ public static VT_0_1_2_5 vtstatic_0_1_2_5 = new VT_0_1_2_5();
+
+
+
+
+
+
+ public static VT_0_1_2_2 vtstatic_0_1_2_2 = new VT_0_1_2_2();
+
+
+
+
+
+
+
+
+ public static VT_0_1 vtstatic_0_1 = new VT_0_1();
+
+
+ public static VT_0 vtstatic_0 = new VT_0();
+
+ public static double Func_0_1_2_5_2(CL_0_1_2_5_2 cl_0_1_2_5_2, double* a5_0_1_2_5_2)
+ {
+ double a2_0_1_2_5_2 = sa + sb;
+ double a3_0_1_2_5_2 = sa - sb;
+
+ vtstatic_0_1_2_5_2.a4_0_1_2_5_2 = sa + sb;
+ double retval_0_1_2_5_2 = Convert.ToDouble((a2_0_1_2_5_2 + ((sa + sb - ((sa - sb + cl_0_1_2_5_2.a0_0_1_2_5_2) / (*a5_0_1_2_5_2))) * (((*a5_0_1_2_5_2) / a3_0_1_2_5_2) + vtstatic_0_1_2_5_2.a4_0_1_2_5_2))));
+ Console.WriteLine("retval_0_1_2_5_2 is {0}", retval_0_1_2_5_2);
+ return retval_0_1_2_5_2;
+ }
+
+ public static double Func_0_1_2_5_1(CL_0_1_2_5_1 cl_0_1_2_5_1)
+ {
+ VT_0_1_2_5_1 vt_0_1_2_5_1 = new VT_0_1_2_5_1();
+ vt_0_1_2_5_1.a1_0_1_2_5_1 = sa * sb;
+
+ double retval_0_1_2_5_1 = Convert.ToDouble((((vt_0_1_2_5_1.a1_0_1_2_5_1 + -sa * sb) - vt_0_1_2_5_1.a1_0_1_2_5_1) * ((vt_0_1_2_5_1.a1_0_1_2_5_1 * 1.0) + ((vt_0_1_2_5_1.a1_0_1_2_5_1 + cl_0_1_2_5_1.arr3d_0_1_2_5_1[4, 0, 3]) - (-sa * sb)))));
+ Console.WriteLine("retval_0_1_2_5_1 is {0}", retval_0_1_2_5_1);
+ return retval_0_1_2_5_1;
+ }
+
+ public static double Func_0_1_2_4_3()
+ {
+ int[,] arr2d_0_1_2_4_3 = new int[3, 11];
+
+ vtstatic_0_1_2_4_3.a0_0_1_2_4_3 = -sa / sb;
+ arr2d_0_1_2_4_3[2, 1] = sa / sb;
+ double retval_0_1_2_4_3 = Convert.ToDouble(((((double)((long)(Convert.ToInt32(arr2d_0_1_2_4_3[2, 1]) + (long)(vtstatic_0_1_2_4_3.a0_0_1_2_4_3)) * 0.25)) + (arr2d_0_1_2_4_3[2, 1] * (0.25 - (-sa / sb)))) - (((-sa / sb + sa + sb) + (-sa + sb * sa * sb)))));
+ Console.WriteLine("retval_0_1_2_4_3 is {0}", retval_0_1_2_4_3);
+ return retval_0_1_2_4_3;
+ }
+
+ public static double Func_0_1_2_4_2(VT_0_1_2_4_2 vt_0_1_2_4_2, double a3_0_1_2_4_2)
+ {
+ double a0_0_1_2_4_2 = -sa / sb;
+
+ double retval_0_1_2_4_2 = Convert.ToDouble(((a0_0_1_2_4_2 + ((a0_0_1_2_4_2 - sa / sb) * a3_0_1_2_4_2)) + ((-sa / sb * ((a3_0_1_2_4_2 - sa / sb) - (vt_0_1_2_4_2.a2_0_1_2_4_2))) + (a0_0_1_2_4_2 + sa / sb))));
+ Console.WriteLine("retval_0_1_2_4_2 is {0}", retval_0_1_2_4_2);
+ return retval_0_1_2_4_2;
+ }
+
+ public static long Func_0_1_2_4_1(int[,,] arr3d_0_1_2_4_1)
+ {
+ CL_0_1_2_4_1 cl_0_1_2_4_1 = new CL_0_1_2_4_1();
+
+ clstatic_0_1_2_4_1.arr3d_0_1_2_4_1[4, 0, 3] = -sa % sb;
+ long retval_0_1_2_4_1 = Convert.ToInt64(((long)(Convert.ToInt32(arr3d_0_1_2_4_1[4, 2, 3]) - (long)((clstatic_0_1_2_4_1.arr3d_0_1_2_4_1[4, 0, 3] - cl_0_1_2_4_1.a1_0_1_2_4_1))) + clstatic_0_1_2_4_1.arr3d_0_1_2_4_1[4, 0, 3]));
+ Console.WriteLine("retval_0_1_2_4_1 is {0}", retval_0_1_2_4_1);
+ return retval_0_1_2_4_1;
+ }
+
+ public static long Func_0_1_2_3_2(int[,] arr2d_0_1_2_3_2, CL_0_1_2_3_2 cl_0_1_2_3_2)
+ {
+ vtstatic_0_1_2_3_2.a2_0_1_2_3_2 = -sa * sb;
+ cl_0_1_2_3_2.arr3d_0_1_2_3_2[4, 0, 3] = sa * sb;
+ long retval_0_1_2_3_2 = Convert.ToInt64((((long)(((long)(vtstatic_0_1_2_3_2.a2_0_1_2_3_2) * (long)(sa + sb)) / -sa * sb)) - (long)(Convert.ToInt32((Convert.ToInt32((Convert.ToInt32(cl_0_1_2_3_2.arr2d_0_1_2_3_2[2, 4])) % (Convert.ToInt32(arr2d_0_1_2_3_2[2, 1]))))) - (long)(((long)(vtstatic_0_1_2_3_2.a2_0_1_2_3_2 / (vtstatic_0_1_2_3_2.a2_0_1_2_3_2 - cl_0_1_2_3_2.arr3d_0_1_2_3_2[4, 0, 3])))))));
+ Console.WriteLine("retval_0_1_2_3_2 is {0}", retval_0_1_2_3_2);
+ return retval_0_1_2_3_2;
+ }
+
+ public static long Func_0_1_2_3_1(CL_0_1_2_3_1 cl_0_1_2_3_1)
+ {
+ VT_0_1_2_3_1 vt_0_1_2_3_1 = new VT_0_1_2_3_1();
+ vt_0_1_2_3_1.a1_0_1_2_3_1 = -sa / sb;
+ vt_0_1_2_3_1.a4_0_1_2_3_1 = sa + sb + sa / sb;
+
+ vtstatic_0_1_2_3_1.a1_0_1_2_3_1 = -sa / sb;
+ vtstatic_0_1_2_3_1.a4_0_1_2_3_1 = sa + sb;
+ cl_0_1_2_3_1.arr1d_0_1_2_3_1[0] = sa / sb;
+ long retval_0_1_2_3_1 = Convert.ToInt64((long)(Convert.ToInt32(((Convert.ToInt32((Convert.ToInt32(cl_0_1_2_3_1.arr3d_0_1_2_3_1[4, 3, 3])) % (Convert.ToInt32(s_a2_0_1_2_3_1)))) + cl_0_1_2_3_1.a5_0_1_2_3_1)) + (long)((long)(Convert.ToInt32(((cl_0_1_2_3_1.a5_0_1_2_3_1 + 0) - ((Convert.ToInt32((Convert.ToInt32(vt_0_1_2_3_1.a1_0_1_2_3_1)) % (Convert.ToInt32(sa + sb))))))) + (long)((vtstatic_0_1_2_3_1.a4_0_1_2_3_1 - cl_0_1_2_3_1.arr1d_0_1_2_3_1[0]))))));
+ Console.WriteLine("retval_0_1_2_3_1 is {0}", retval_0_1_2_3_1);
+ return retval_0_1_2_3_1;
+ }
+
+ public static double Func_0_1_2_2_2(int[,] arr2d_0_1_2_2_2, VT_0_1_2_2_2 vt_0_1_2_2_2, CL_0_1_2_2_2 cl_0_1_2_2_2)
+ {
+ double retval_0_1_2_2_2 = Convert.ToDouble(((-sa * sb * (cl_0_1_2_2_2.a4_0_1_2_2_2 + (cl_0_1_2_2_2.a4_0_1_2_2_2 - (vt_0_1_2_2_2.a3_0_1_2_2_2)))) - ((arr2d_0_1_2_2_2[2, 0] - (Convert.ToInt32(arr2d_0_1_2_2_2[2, 0] * sa * sb))) / (-sa * sb / s_a1_0_1_2_2_2))));
+ Console.WriteLine("retval_0_1_2_2_2 is {0}", retval_0_1_2_2_2);
+ return retval_0_1_2_2_2;
+ }
+
+ public static double Func_0_1_2_2_1(VT_0_1_2_2_1 vt_0_1_2_2_1)
+ {
+ vtstatic_0_1_2_2_1.a0_0_1_2_2_1 = -sa + sb;
+ vtstatic_0_1_2_2_1.a1_0_1_2_2_1 = sa + sb * sb;
+ vtstatic_0_1_2_2_1.a4_0_1_2_2_1 = sb * sa + sb * sa;
+ vtstatic_0_1_2_2_1.a5_0_1_2_2_1 = sa - sb * sb;
+ clstatic_0_1_2_2_1.arr2d_0_1_2_2_1[2, 3] = sa * sb - sb;
+ double retval_0_1_2_2_1 = Convert.ToDouble((((sa + sb * sb - vtstatic_0_1_2_2_1.a1_0_1_2_2_1) + ((vtstatic_0_1_2_2_1.a1_0_1_2_2_1 + 0.0) / (20.0 - (sb * sa + sb * sa)))) - (((double)(((long)(vtstatic_0_1_2_2_1.a0_0_1_2_2_1 / (vtstatic_0_1_2_2_1.a0_0_1_2_2_1 + vt_0_1_2_2_1.a5_0_1_2_2_1 + sa - sb))) * (clstatic_0_1_2_2_1.arr2d_0_1_2_2_1[2, 3] * vtstatic_0_1_2_2_1.a4_0_1_2_2_1))))));
+ Console.WriteLine("retval_0_1_2_2_1 is {0}", retval_0_1_2_2_1);
+ return retval_0_1_2_2_1;
+ }
+
+ public static double Func_0_1_2_1_2(VT_0_1_2_1_2 vt_0_1_2_1_2)
+ {
+ CL_0_1_2_1_2 cl_0_1_2_1_2 = new CL_0_1_2_1_2();
+
+ double retval_0_1_2_1_2 = Convert.ToDouble(((vt_0_1_2_1_2.a1_0_1_2_1_2 / (cl_0_1_2_1_2.a0_0_1_2_1_2 - (vt_0_1_2_1_2.a4_0_1_2_1_2))) - cl_0_1_2_1_2.a0_0_1_2_1_2));
+ Console.WriteLine("retval_0_1_2_1_2 is {0}", retval_0_1_2_1_2);
+ return retval_0_1_2_1_2;
+ }
+
+ public static double Func_0_1_2_1_1()
+ {
+ VT_0_1_2_1_1 vt_0_1_2_1_1 = new VT_0_1_2_1_1();
+ vt_0_1_2_1_1.a0_0_1_2_1_1 = (sa + sb) * (sa + sb);
+ vt_0_1_2_1_1.a3_0_1_2_1_1 = -(sa + sb) / (sa - sb);
+ vt_0_1_2_1_1.a4_0_1_2_1_1 = -(sa + sb) / (sa * sb);
+
+ double retval_0_1_2_1_1 = Convert.ToDouble((((vt_0_1_2_1_1.a3_0_1_2_1_1 - vt_0_1_2_1_1.a0_0_1_2_1_1) + vt_0_1_2_1_1.a3_0_1_2_1_1) - ((vt_0_1_2_1_1.a3_0_1_2_1_1 - vt_0_1_2_1_1.a0_0_1_2_1_1) - ((vt_0_1_2_1_1.a0_0_1_2_1_1 + vt_0_1_2_1_1.a4_0_1_2_1_1)))));
+ Console.WriteLine("retval_0_1_2_1_1 is {0}", retval_0_1_2_1_1);
+ return retval_0_1_2_1_1;
+ }
+
+ public static double Func_0_1_2_5(CL_0_1_2_5 cl_0_1_2_5)
+ {
+ VT_0_1_2_5 vt_0_1_2_5 = new VT_0_1_2_5();
+ vt_0_1_2_5.a1_0_1_2_5 = sa - sb;
+ vt_0_1_2_5.a2_0_1_2_5 = sa * sb;
+
+ vtstatic_0_1_2_5.a1_0_1_2_5 = sa - sb;
+ vtstatic_0_1_2_5.a2_0_1_2_5 = sa - sb;
+ CL_0_1_2_5_2 cl_0_1_2_5_2 = new CL_0_1_2_5_2();
+ double* a5_0_1_2_5_2 = stackalloc double[1];
+ *a5_0_1_2_5_2 = sa * sb;
+ double val_0_1_2_5_2 = Func_0_1_2_5_2(cl_0_1_2_5_2, a5_0_1_2_5_2);
+ CL_0_1_2_5_1 cl_0_1_2_5_1 = new CL_0_1_2_5_1();
+ cl_0_1_2_5_1.arr3d_0_1_2_5_1[4, 0, 3] = sa * sb;
+ double val_0_1_2_5_1 = Func_0_1_2_5_1(cl_0_1_2_5_1);
+ double retval_0_1_2_5 = Convert.ToDouble(((Convert.ToInt32((cl_0_1_2_5.arr2d_0_1_2_5[2, 0] * vt_0_1_2_5.a1_0_1_2_5) - (vtstatic_0_1_2_5.a2_0_1_2_5 + (vtstatic_0_1_2_5.a2_0_1_2_5 + (vtstatic_0_1_2_5.a2_0_1_2_5 + val_0_1_2_5_2))))) * val_0_1_2_5_1));
+ Console.WriteLine("retval_0_1_2_5 is {0}", retval_0_1_2_5);
+ return retval_0_1_2_5;
+ }
+
+ public static long Func_0_1_2_4(long* a0_0_1_2_4)
+ {
+ double val_0_1_2_4_3 = Func_0_1_2_4_3();
+ VT_0_1_2_4_2 vt_0_1_2_4_2 = new VT_0_1_2_4_2();
+ vt_0_1_2_4_2.a2_0_1_2_4_2 = -sa * sb;
+ double a3_0_1_2_4_2 = -sa * sb;
+ double val_0_1_2_4_2 = Func_0_1_2_4_2(vt_0_1_2_4_2, a3_0_1_2_4_2);
+ int[,,] arr3d_0_1_2_4_1 = new int[5, 11, 4];
+ arr3d_0_1_2_4_1[4, 2, 3] = sa * sb;
+ long val_0_1_2_4_1 = Func_0_1_2_4_1(arr3d_0_1_2_4_1);
+ long retval_0_1_2_4 = Convert.ToInt64((long)(Convert.ToInt32((Convert.ToInt32(((*a0_0_1_2_4) / val_0_1_2_4_3) + val_0_1_2_4_2))) - (long)(val_0_1_2_4_1)));
+ Console.WriteLine("retval_0_1_2_4 is {0}", retval_0_1_2_4);
+ return retval_0_1_2_4;
+ }
+
+ public static int Func_0_1_2_3()
+ {
+ VT_0_1_2_3 vt_0_1_2_3 = new VT_0_1_2_3();
+ vt_0_1_2_3.a1_0_1_2_3 = -sa - sb;
+ vt_0_1_2_3.a2_0_1_2_3 = sa + sb;
+ long[,] arr2d_0_1_2_3 = new long[3, 11];
+ int a3_0_1_2_3 = sa / sb;
+
+ arr2d_0_1_2_3[2, 0] = sa / sb;
+ CL_0_1_2_3_2 cl_0_1_2_3_2 = new CL_0_1_2_3_2();
+ int[,] arr2d_0_1_2_3_2 = new int[3, 11];
+ arr2d_0_1_2_3_2[2, 1] = sa + sb;
+ cl_0_1_2_3_2.arr2d_0_1_2_3_2[2, 4] = sa - sb;
+ long val_0_1_2_3_2 = Func_0_1_2_3_2(arr2d_0_1_2_3_2, cl_0_1_2_3_2);
+ CL_0_1_2_3_1 cl_0_1_2_3_1 = new CL_0_1_2_3_1();
+ cl_0_1_2_3_1.arr3d_0_1_2_3_1[4, 3, 3] = sa - sb;
+ long val_0_1_2_3_1 = Func_0_1_2_3_1(cl_0_1_2_3_1);
+ int retval_0_1_2_3 = Convert.ToInt32((Convert.ToInt32((long)((long)(Convert.ToInt32((a3_0_1_2_3 - (vt_0_1_2_3.a1_0_1_2_3))) + (long)((long)(Convert.ToInt32((Convert.ToInt32((long)(arr2d_0_1_2_3[2, 0]) - (long)(val_0_1_2_3_2)))) + (long)(arr2d_0_1_2_3[2, 0]))))) - (long)((long)(Convert.ToInt32(((sa + sb) / vt_0_1_2_3.a2_0_1_2_3)) - (long)(val_0_1_2_3_1))))));
+ Console.WriteLine("retval_0_1_2_3 is {0}", retval_0_1_2_3);
+ return retval_0_1_2_3;
+ }
+
+ public static long Func_0_1_2_2(long[,] arr2d_0_1_2_2)
+ {
+ vtstatic_0_1_2_2.a3_0_1_2_2 = -(sa - sb);
+ VT_0_1_2_2_2 vt_0_1_2_2_2 = new VT_0_1_2_2_2();
+ vt_0_1_2_2_2.a3_0_1_2_2_2 = -sa / sb;
+ CL_0_1_2_2_2 cl_0_1_2_2_2 = new CL_0_1_2_2_2();
+ int[,] arr2d_0_1_2_2_2 = new int[3, 11];
+ arr2d_0_1_2_2_2[2, 0] = sa - sb;
+ double val_0_1_2_2_2 = Func_0_1_2_2_2(arr2d_0_1_2_2_2, vt_0_1_2_2_2, cl_0_1_2_2_2);
+ VT_0_1_2_2_1 vt_0_1_2_2_1 = new VT_0_1_2_2_1();
+ vt_0_1_2_2_1.a0_0_1_2_2_1 = -sa / sb;
+ vt_0_1_2_2_1.a1_0_1_2_2_1 = sa / sb;
+ vt_0_1_2_2_1.a4_0_1_2_2_1 = sa - sb;
+ vt_0_1_2_2_1.a5_0_1_2_2_1 = sa - sb;
+ double val_0_1_2_2_1 = Func_0_1_2_2_1(vt_0_1_2_2_1);
+ long retval_0_1_2_2 = Convert.ToInt64(((long)(Convert.ToInt32((Convert.ToInt32((val_0_1_2_2_1 - (val_0_1_2_2_2)) + vtstatic_0_1_2_2.a3_0_1_2_2))) - (long)(arr2d_0_1_2_2[2, 0])) - arr2d_0_1_2_2[2, 1]));
+ Console.WriteLine("retval_0_1_2_2 is {0}", retval_0_1_2_2);
+ return retval_0_1_2_2;
+ }
+
+ public static double Func_0_1_2_1(CL_0_1_2_1 cl_0_1_2_1, VT_0_1_2_1 vt_0_1_2_1)
+ {
+ VT_0_1_2_1_2 vt_0_1_2_1_2 = new VT_0_1_2_1_2();
+ vt_0_1_2_1_2.a1_0_1_2_1_2 = 1;
+ vt_0_1_2_1_2.a4_0_1_2_1_2 = -(sa / sb);
+ double val_0_1_2_1_2 = Func_0_1_2_1_2(vt_0_1_2_1_2);
+ double val_0_1_2_1_1 = Func_0_1_2_1_1();
+ double retval_0_1_2_1 = Convert.ToDouble(((((vt_0_1_2_1.a1_0_1_2_1 + ((double)(cl_0_1_2_1.arr2d_0_1_2_1[2, 0] * (sa / sb)))) * vt_0_1_2_1.a1_0_1_2_1) + val_0_1_2_1_1) / (((double)(cl_0_1_2_1.arr2d_0_1_2_1[2, 0] * val_0_1_2_1_2)) - (vt_0_1_2_1.a3_0_1_2_1))));
+ Console.WriteLine("retval_0_1_2_1 is {0}", retval_0_1_2_1);
+ return retval_0_1_2_1;
+ }
+
+ public static long Func_0_1_2(VT_0_1_2 vt_0_1_2)
+ {
+ CL_0_1_2_5 cl_0_1_2_5 = new CL_0_1_2_5();
+ cl_0_1_2_5.arr2d_0_1_2_5[2, 0] = sa * sb;
+ double val_0_1_2_5 = Func_0_1_2_5(cl_0_1_2_5);
+ long* a0_0_1_2_4 = stackalloc long[1];
+ *a0_0_1_2_4 = sa + sb;
+ long val_0_1_2_4 = Func_0_1_2_4(a0_0_1_2_4);
+ int val_0_1_2_3 = Func_0_1_2_3();
+ long[,] arr2d_0_1_2_2 = new long[3, 11];
+ arr2d_0_1_2_2[2, 0] = -sa * sb;
+ arr2d_0_1_2_2[2, 1] = sa * (sa + sb);
+ long val_0_1_2_2 = Func_0_1_2_2(arr2d_0_1_2_2);
+ VT_0_1_2_1 vt_0_1_2_1 = new VT_0_1_2_1();
+ vt_0_1_2_1.a1_0_1_2_1 = -(sa * sb);
+ vt_0_1_2_1.a3_0_1_2_1 = -sa + sb;
+ CL_0_1_2_1 cl_0_1_2_1 = new CL_0_1_2_1();
+ cl_0_1_2_1.arr2d_0_1_2_1[2, 0] = 2L;
+ double val_0_1_2_1 = Func_0_1_2_1(cl_0_1_2_1, vt_0_1_2_1);
+ long retval_0_1_2 = Convert.ToInt64((long)(Convert.ToInt32((Convert.ToInt32(val_0_1_2_5 - ((val_0_1_2_3 * vt_0_1_2.a0_0_1_2))))) + (long)((((long)((long)(Convert.ToInt32(sa + sb) - (long)(val_0_1_2_2)) / val_0_1_2_1)) + val_0_1_2_4))));
+ Console.WriteLine("retval_0_1_2 is {0}", retval_0_1_2);
+ return retval_0_1_2;
+ }
+
+ public static double Func_0_1_1()
+ {
+ double[,] arr2d_0_1_1 = new double[3, 11];
+
+ arr2d_0_1_1[2, 0] = 0.0;
+ double retval_0_1_1 = Convert.ToDouble(arr2d_0_1_1[2, 0]);
+ Console.WriteLine("retval_0_1_1 is {0}", retval_0_1_1);
+ return retval_0_1_1;
+ }
+
+ public static double Func_0_1(long[] arr1d_0_1, VT_0_1 vt_0_1)
+ {
+ CL_0_1 cl_0_1 = new CL_0_1();
+
+ vtstatic_0_1.a2_0_1 = sa + sb;
+ vtstatic_0_1.a3_0_1 = sa + sb;
+ VT_0_1_2 vt_0_1_2 = new VT_0_1_2();
+ vt_0_1_2.a0_0_1_2 = -(sa + sb);
+ long val_0_1_2 = Func_0_1_2(vt_0_1_2);
+ double val_0_1_1 = Func_0_1_1();
+ double retval_0_1 = Convert.ToDouble((((((long)(val_0_1_2 / arr1d_0_1[0])) / (vtstatic_0_1.a3_0_1 * (sa + sb))) + val_0_1_1) * ((vt_0_1.a2_0_1 * (sa + sb)) * (cl_0_1.a1_0_1 - ((arr1d_0_1[0] / -(sa + sb)))))));
+ Console.WriteLine("retval_0_1 is {0}", retval_0_1);
+ return retval_0_1;
+ }
+
+ public static int Func_0(double[,] arr2d_0, VT_0 vt_0)
+ {
+ vtstatic_0.a2_0 = sa / sb;
+ vtstatic_0.a3_0 = sa - sb;
+ vtstatic_0.a4_0 = sa - sb;
+ VT_0_1 vt_0_1 = new VT_0_1();
+ vt_0_1.a2_0_1 = sa + sb;
+ vt_0_1.a3_0_1 = sa / sb;
+ long[] arr1d_0_1 = new long[11];
+ arr1d_0_1[0] = 2L;
+ double val_0_1 = Func_0_1(arr1d_0_1, vt_0_1);
+ int retval_0 = Convert.ToInt32((Convert.ToInt32((Convert.ToInt32((val_0_1 - vtstatic_0.a3_0) + (vtstatic_0.a3_0 + (sa * sb)))) * (vtstatic_0.a4_0 / (((vt_0.a2_0 - (sb - sa)) * (vtstatic_0.a4_0 * sa * sb)) - (arr2d_0[2, 0]))))));
+ Console.WriteLine("retval_0 is {0}", retval_0);
+ return retval_0;
+ }
+
+ public static int Main()
+ {
+ sa = 10;
+ sb = 5;
+ vtstatic_0.a2_0 = sa + sb;
+ vtstatic_0.a3_0 = sa * sb;
+ vtstatic_0.a4_0 = sa - sb;
+ VT_0 vt_0 = new VT_0();
+ vt_0.a2_0 = sa * sb;
+ vt_0.a3_0 = sa + sb;
+ vt_0.a4_0 = sa - sb;
+ double[,] arr2d_0 = new double[3, 11];
+ arr2d_0[2, 0] = sa * sb;
+
+ int retval;
+ retval = Func_0(arr2d_0, vt_0);
+ if (retval != 4858)
+ {
+ Console.WriteLine("FAILED");
+ return 1;
+ }
+ else
+ {
+ Console.WriteLine("PASSED");
+ return 100;
+ }
+ }
+}
diff --git a/tests/src/JIT/Directed/coverage/oldtests/lclfldadd.cs b/tests/src/JIT/Directed/coverage/oldtests/lclfldadd.cs
new file mode 100644
index 0000000000..fc4fe19725
--- /dev/null
+++ b/tests/src/JIT/Directed/coverage/oldtests/lclfldadd.cs
@@ -0,0 +1,559 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+//
+
+//Testing simple math on local vars and fields - add
+
+#pragma warning disable 0414
+using System;
+internal class lclfldadd
+{
+ //user-defined class that overloads operator +
+ public class numHolder
+ {
+ private int _num;
+ private uint _ui_num;
+ private long _num;
+ private ulong _ul_num;
+ private float _num;
+ private double _num;
+ private decimal _num;
+ public numHolder(int i_num)
+ {
+ _num = Convert.ToInt32(i_num);
+ _ui_num = Convert.ToUInt32(i_num);
+ _num = Convert.ToInt64(i_num);
+ _ul_num = Convert.ToUInt64(i_num);
+ _num = Convert.ToSingle(i_num);
+ _num = Convert.ToDouble(i_num);
+ _num = Convert.ToDecimal(i_num);
+ }
+
+ public static int operator +(numHolder a, int b)
+ {
+ return a._num + b;
+ }
+
+ public numHolder(uint ui_num)
+ {
+ _num = Convert.ToInt32(ui_num);
+ _ui_num = Convert.ToUInt32(ui_num);
+ _num = Convert.ToInt64(ui_num);
+ _ul_num = Convert.ToUInt64(ui_num);
+ _num = Convert.ToSingle(ui_num);
+ _num = Convert.ToDouble(ui_num);
+ _num = Convert.ToDecimal(ui_num);
+ }
+
+ public static uint operator +(numHolder a, uint b)
+ {
+ return a._ui_num + b;
+ }
+
+ public numHolder(long l_num)
+ {
+ _num = Convert.ToInt32(l_num);
+ _ui_num = Convert.ToUInt32(l_num);
+ this._num = Convert.ToInt64(l_num);
+ _ul_num = Convert.ToUInt64(l_num);
+ _num = Convert.ToSingle(l_num);
+ _num = Convert.ToDouble(l_num);
+ _num = Convert.ToDecimal(l_num);
+ }
+
+ public static long operator +(numHolder a, long b)
+ {
+ return a._num + b;
+ }
+
+ public numHolder(ulong ul_num)
+ {
+ _num = Convert.ToInt32(ul_num);
+ _ui_num = Convert.ToUInt32(ul_num);
+ _num = Convert.ToInt64(ul_num);
+ _ul_num = Convert.ToUInt64(ul_num);
+ _num = Convert.ToSingle(ul_num);
+ _num = Convert.ToDouble(ul_num);
+ _num = Convert.ToDecimal(ul_num);
+ }
+
+ public static long operator +(numHolder a, ulong b)
+ {
+ return (long)(a._ul_num + b);
+ }
+
+ public numHolder(float f_num)
+ {
+ _num = Convert.ToInt32(f_num);
+ _ui_num = Convert.ToUInt32(f_num);
+ _num = Convert.ToInt64(f_num);
+ _ul_num = Convert.ToUInt64(f_num);
+ this._num = Convert.ToSingle(f_num);
+ _num = Convert.ToDouble(f_num);
+ _num = Convert.ToDecimal(f_num);
+ }
+
+ public static float operator +(numHolder a, float b)
+ {
+ return a._num + b;
+ }
+
+ public numHolder(double d_num)
+ {
+ _num = Convert.ToInt32(d_num);
+ _ui_num = Convert.ToUInt32(d_num);
+ _num = Convert.ToInt64(d_num);
+ _ul_num = Convert.ToUInt64(d_num);
+ _num = Convert.ToSingle(d_num);
+ this._num = Convert.ToDouble(d_num);
+ _num = Convert.ToDecimal(d_num);
+ }
+
+ public static double operator +(numHolder a, double b)
+ {
+ return a._num + b;
+ }
+
+ public numHolder(decimal m_num)
+ {
+ _num = Convert.ToInt32(m_num);
+ _ui_num = Convert.ToUInt32(m_num);
+ _num = Convert.ToInt64(m_num);
+ _ul_num = Convert.ToUInt64(m_num);
+ _num = Convert.ToSingle(m_num);
+ _num = Convert.ToDouble(m_num);
+ this._num = Convert.ToDecimal(m_num);
+ }
+
+ public static int operator +(numHolder a, decimal b)
+ {
+ return (int)(a._num + b);
+ }
+
+ public static int operator +(numHolder a, numHolder b)
+ {
+ return a._num + b._num;
+ }
+ }
+
+ private static int s_s_op1 = 1;
+ private static uint s_ui_s_op1 = 1;
+ private static long s_s_op1 = 1;
+ private static ulong s_ul_s_op1 = 1;
+ private static float s_s_op1 = 1;
+ private static double s_s_op1 = 1;
+ private static decimal s_s_op1 = 1;
+
+ private static int s_s_op2 = 8;
+ private static uint s_ui_s_op2 = 8;
+ private static long s_s_op2 = 8;
+ private static ulong s_ul_s_op2 = 8;
+ private static float s_s_op2 = 8;
+ private static double s_s_op2 = 8;
+ private static decimal s_s_op2 = 8;
+ private static numHolder s_nHldr_s_op2 = new numHolder(8);
+
+ public static int i_f(String s)
+ {
+ if (s == "op1")
+ return 1;
+ else
+ return 8;
+ }
+ public static uint ui_f(String s)
+ {
+ if (s == "op1")
+ return 1;
+ else
+ return 8;
+ }
+ public static long l_f(String s)
+ {
+ if (s == "op1")
+ return 1;
+ else
+ return 8;
+ }
+ public static ulong ul_f(String s)
+ {
+ if (s == "op1")
+ return 1;
+ else
+ return 8;
+ }
+ public static float f_f(String s)
+ {
+ if (s == "op1")
+ return 1;
+ else
+ return 8;
+ }
+ public static double d_f(String s)
+ {
+ if (s == "op1")
+ return 1;
+ else
+ return 8;
+ }
+ public static decimal m_f(String s)
+ {
+ if (s == "op1")
+ return 1;
+ else
+ return 8;
+ }
+ public static numHolder nHldr_f(String s)
+ {
+ if (s == "op1")
+ return new numHolder(1);
+ else
+ return new numHolder(8);
+ }
+ private class CL
+ {
+ public int i_cl_op1 = 1;
+ public uint ui_cl_op1 = 1;
+ public long l_cl_op1 = 1;
+ public ulong ul_cl_op1 = 1;
+ public float f_cl_op1 = 1;
+ public double d_cl_op1 = 1;
+ public decimal m_cl_op1 = 1;
+
+ public int i_cl_op2 = 8;
+ public uint ui_cl_op2 = 8;
+ public long l_cl_op2 = 8;
+ public ulong ul_cl_op2 = 8;
+ public float f_cl_op2 = 8;
+ public double d_cl_op2 = 8;
+ public decimal m_cl_op2 = 8;
+ public numHolder nHldr_cl_op2 = new numHolder(8);
+ }
+
+ private struct VT
+ {
+ public int i_vt_op1;
+ public uint ui_vt_op1;
+ public long l_vt_op1;
+ public ulong ul_vt_op1;
+ public float f_vt_op1;
+ public double d_vt_op1;
+ public decimal m_vt_op1;
+
+ public int i_vt_op2;
+ public uint ui_vt_op2;
+ public long l_vt_op2;
+ public ulong ul_vt_op2;
+ public float f_vt_op2;
+ public double d_vt_op2;
+ public decimal m_vt_op2;
+ public numHolder nHldr_vt_op2;
+ }
+
+ public static int Main()
+ {
+ bool passed = true;
+ //initialize class
+ CL cl1 = new CL();
+ //initialize struct
+ VT vt1;
+ vt1.i_vt_op1 = 1;
+ vt1.ui_vt_op1 = 1;
+ vt1.l_vt_op1 = 1;
+ vt1.ul_vt_op1 = 1;
+ vt1.f_vt_op1 = 1;
+ vt1.d_vt_op1 = 1;
+ vt1.m_vt_op1 = 1;
+ vt1.i_vt_op2 = 8;
+ vt1.ui_vt_op2 = 8;
+ vt1.l_vt_op2 = 8;
+ vt1.ul_vt_op2 = 8;
+ vt1.f_vt_op2 = 8;
+ vt1.d_vt_op2 = 8;
+ vt1.m_vt_op2 = 8;
+ vt1.nHldr_vt_op2 = new numHolder(8);
+
+ int[] i_arr1d_op1 = { 0, 1 };
+ int[,] i_arr2d_op1 = { { 0, 1 }, { 1, 1 } };
+ int[,,] i_arr3d_op1 = { { { 0, 1 }, { 1, 1 } } };
+ uint[] ui_arr1d_op1 = { 0, 1 };
+ uint[,] ui_arr2d_op1 = { { 0, 1 }, { 1, 1 } };
+ uint[,,] ui_arr3d_op1 = { { { 0, 1 }, { 1, 1 } } };
+ long[] l_arr1d_op1 = { 0, 1 };
+ long[,] l_arr2d_op1 = { { 0, 1 }, { 1, 1 } };
+ long[,,] l_arr3d_op1 = { { { 0, 1 }, { 1, 1 } } };
+ ulong[] ul_arr1d_op1 = { 0, 1 };
+ ulong[,] ul_arr2d_op1 = { { 0, 1 }, { 1, 1 } };
+ ulong[,,] ul_arr3d_op1 = { { { 0, 1 }, { 1, 1 } } };
+ float[] f_arr1d_op1 = { 0, 1 };
+ float[,] f_arr2d_op1 = { { 0, 1 }, { 1, 1 } };
+ float[,,] f_arr3d_op1 = { { { 0, 1 }, { 1, 1 } } };
+ double[] d_arr1d_op1 = { 0, 1 };
+ double[,] d_arr2d_op1 = { { 0, 1 }, { 1, 1 } };
+ double[,,] d_arr3d_op1 = { { { 0, 1 }, { 1, 1 } } };
+ decimal[] m_arr1d_op1 = { 0, 1 };
+ decimal[,] m_arr2d_op1 = { { 0, 1 }, { 1, 1 } };
+ decimal[,,] m_arr3d_op1 = { { { 0, 1 }, { 1, 1 } } };
+
+ int[] i_arr1d_op2 = { 8, 0, 1 };
+ int[,] i_arr2d_op2 = { { 0, 8 }, { 1, 1 } };
+ int[,,] i_arr3d_op2 = { { { 0, 8 }, { 1, 1 } } };
+ uint[] ui_arr1d_op2 = { 8, 0, 1 };
+ uint[,] ui_arr2d_op2 = { { 0, 8 }, { 1, 1 } };
+ uint[,,] ui_arr3d_op2 = { { { 0, 8 }, { 1, 1 } } };
+ long[] l_arr1d_op2 = { 8, 0, 1 };
+ long[,] l_arr2d_op2 = { { 0, 8 }, { 1, 1 } };
+ long[,,] l_arr3d_op2 = { { { 0, 8 }, { 1, 1 } } };
+ ulong[] ul_arr1d_op2 = { 8, 0, 1 };
+ ulong[,] ul_arr2d_op2 = { { 0, 8 }, { 1, 1 } };
+ ulong[,,] ul_arr3d_op2 = { { { 0, 8 }, { 1, 1 } } };
+ float[] f_arr1d_op2 = { 8, 0, 1 };
+ float[,] f_arr2d_op2 = { { 0, 8 }, { 1, 1 } };
+ float[,,] f_arr3d_op2 = { { { 0, 8 }, { 1, 1 } } };
+ double[] d_arr1d_op2 = { 8, 0, 1 };
+ double[,] d_arr2d_op2 = { { 0, 8 }, { 1, 1 } };
+ double[,,] d_arr3d_op2 = { { { 0, 8 }, { 1, 1 } } };
+ decimal[] m_arr1d_op2 = { 8, 0, 1 };
+ decimal[,] m_arr2d_op2 = { { 0, 8 }, { 1, 1 } };
+ decimal[,,] m_arr3d_op2 = { { { 0, 8 }, { 1, 1 } } };
+ numHolder[] nHldr_arr1d_op2 = { new numHolder(8), new numHolder(0), new numHolder(1) };
+ numHolder[,] nHldr_arr2d_op2 = { { new numHolder(0), new numHolder(8) }, { new numHolder(1), new numHolder(1) } };
+ numHolder[,,] nHldr_arr3d_op2 = { { { new numHolder(0), new numHolder(8) }, { new numHolder(1), new numHolder(1) } } };
+
+ int[,] index = { { 0, 0 }, { 1, 1 } };
+
+ {
+ int i_l_op1 = 1;
+ int i_l_op2 = 8;
+ uint ui_l_op2 = 8;
+ long l_l_op2 = 8;
+ ulong ul_l_op2 = 8;
+ float f_l_op2 = 8;
+ double d_l_op2 = 8;
+ decimal m_l_op2 = 8;
+ numHolder nHldr_l_op2 = new numHolder(8);
+ if ((i_l_op1 + i_l_op2 != i_l_op1 + ui_l_op2) || (i_l_op1 + ui_l_op2 != i_l_op1 + l_l_op2) || (i_l_op1 + l_l_op2 != i_l_op1 + (int)ul_l_op2) || (i_l_op1 + (int)ul_l_op2 != i_l_op1 + f_l_op2) || (i_l_op1 + f_l_op2 != i_l_op1 + d_l_op2) || ((decimal)(i_l_op1 + d_l_op2) != i_l_op1 + m_l_op2) || (i_l_op1 + m_l_op2 != i_l_op1 + i_l_op2) || (i_l_op1 + i_l_op2 != 9))
+ {
+ Console.WriteLine("testcase 1 failed");
+ passed = false;
+ }
+ if ((i_l_op1 + s_s_op2 != i_l_op1 + s_ui_s_op2) || (i_l_op1 + s_ui_s_op2 != i_l_op1 + s_s_op2) || (i_l_op1 + s_s_op2 != i_l_op1 + (int)s_ul_s_op2) || (i_l_op1 + (int)s_ul_s_op2 != i_l_op1 + s_s_op2) || (i_l_op1 + s_s_op2 != i_l_op1 + s_s_op2) || ((decimal)(i_l_op1 + s_s_op2) != i_l_op1 + s_s_op2) || (i_l_op1 + s_s_op2 != i_l_op1 + s_s_op2) || (i_l_op1 + s_s_op2 != 9))
+ {
+ Console.WriteLine("testcase 2 failed");
+ passed = false;
+ }
+ if ((s_s_op1 + i_l_op2 != s_s_op1 + ui_l_op2) || (s_s_op1 + ui_l_op2 != s_s_op1 + l_l_op2) || (s_s_op1 + l_l_op2 != s_s_op1 + (int)ul_l_op2) || (s_s_op1 + (int)ul_l_op2 != s_s_op1 + f_l_op2) || (s_s_op1 + f_l_op2 != s_s_op1 + d_l_op2) || ((decimal)(s_s_op1 + d_l_op2) != s_s_op1 + m_l_op2) || (s_s_op1 + m_l_op2 != s_s_op1 + i_l_op2) || (s_s_op1 + i_l_op2 != 9))
+ {
+ Console.WriteLine("testcase 3 failed");
+ passed = false;
+ }
+ if ((s_s_op1 + s_s_op2 != s_s_op1 + s_ui_s_op2) || (s_s_op1 + s_ui_s_op2 != s_s_op1 + s_s_op2) || (s_s_op1 + s_s_op2 != s_s_op1 + (int)s_ul_s_op2) || (s_s_op1 + (int)s_ul_s_op2 != s_s_op1 + s_s_op2) || (s_s_op1 + s_s_op2 != s_s_op1 + s_s_op2) || ((decimal)(s_s_op1 + s_s_op2) != s_s_op1 + s_s_op2) || (s_s_op1 + s_s_op2 != s_s_op1 + s_s_op2) || (s_s_op1 + s_s_op2 != 9))
+ {
+ Console.WriteLine("testcase 4 failed");
+ passed = false;
+ }
+ }
+
+ {
+ uint ui_l_op1 = 1;
+ int i_l_op2 = 8;
+ uint ui_l_op2 = 8;
+ long l_l_op2 = 8;
+ ulong ul_l_op2 = 8;
+ float f_l_op2 = 8;
+ double d_l_op2 = 8;
+ decimal m_l_op2 = 8;
+ numHolder nHldr_l_op2 = new numHolder(8);
+ if ((ui_l_op1 + i_l_op2 != ui_l_op1 + ui_l_op2) || (ui_l_op1 + ui_l_op2 != ui_l_op1 + l_l_op2) || ((ulong)(ui_l_op1 + l_l_op2) != ui_l_op1 + ul_l_op2) || (ui_l_op1 + ul_l_op2 != ui_l_op1 + f_l_op2) || (ui_l_op1 + f_l_op2 != ui_l_op1 + d_l_op2) || ((decimal)(ui_l_op1 + d_l_op2) != ui_l_op1 + m_l_op2) || (ui_l_op1 + m_l_op2 != ui_l_op1 + i_l_op2) || (ui_l_op1 + i_l_op2 != 9))
+ {
+ Console.WriteLine("testcase 5 failed");
+ passed = false;
+ }
+ if ((ui_l_op1 + s_s_op2 != ui_l_op1 + s_ui_s_op2) || (ui_l_op1 + s_ui_s_op2 != ui_l_op1 + s_s_op2) || ((ulong)(ui_l_op1 + s_s_op2) != ui_l_op1 + s_ul_s_op2) || (ui_l_op1 + s_ul_s_op2 != ui_l_op1 + s_s_op2) || (ui_l_op1 + s_s_op2 != ui_l_op1 + s_s_op2) || ((decimal)(ui_l_op1 + s_s_op2) != ui_l_op1 + s_s_op2) || (ui_l_op1 + s_s_op2 != ui_l_op1 + s_s_op2) || (ui_l_op1 + s_s_op2 != 9))
+ {
+ Console.WriteLine("testcase 6 failed");
+ passed = false;
+ }
+ if ((s_ui_s_op1 + i_l_op2 != s_ui_s_op1 + ui_l_op2) || (s_ui_s_op1 + ui_l_op2 != s_ui_s_op1 + l_l_op2) || ((ulong)(s_ui_s_op1 + l_l_op2) != s_ui_s_op1 + ul_l_op2) || (s_ui_s_op1 + ul_l_op2 != s_ui_s_op1 + f_l_op2) || (s_ui_s_op1 + f_l_op2 != s_ui_s_op1 + d_l_op2) || ((decimal)(s_ui_s_op1 + d_l_op2) != s_ui_s_op1 + m_l_op2) || (s_ui_s_op1 + m_l_op2 != s_ui_s_op1 + i_l_op2) || (s_ui_s_op1 + i_l_op2 != 9))
+ {
+ Console.WriteLine("testcase 7 failed");
+ passed = false;
+ }
+ if ((s_ui_s_op1 + s_s_op2 != s_ui_s_op1 + s_ui_s_op2) || (s_ui_s_op1 + s_ui_s_op2 != s_ui_s_op1 + s_s_op2) || ((ulong)(s_ui_s_op1 + s_s_op2) != s_ui_s_op1 + s_ul_s_op2) || (s_ui_s_op1 + s_ul_s_op2 != s_ui_s_op1 + s_s_op2) || (s_ui_s_op1 + s_s_op2 != s_ui_s_op1 + s_s_op2) || ((decimal)(s_ui_s_op1 + s_s_op2) != s_ui_s_op1 + s_s_op2) || (s_ui_s_op1 + s_s_op2 != s_ui_s_op1 + s_s_op2) || (s_ui_s_op1 + s_s_op2 != 9))
+ {
+ Console.WriteLine("testcase 8 failed");
+ passed = false;
+ }
+ }
+
+ {
+ long l_l_op1 = 1;
+ int i_l_op2 = 8;
+ uint ui_l_op2 = 8;
+ long l_l_op2 = 8;
+ ulong ul_l_op2 = 8;
+ float f_l_op2 = 8;
+ double d_l_op2 = 8;
+ decimal m_l_op2 = 8;
+ numHolder nHldr_l_op2 = new numHolder(8);
+ if ((l_l_op1 + i_l_op2 != l_l_op1 + ui_l_op2) || (l_l_op1 + ui_l_op2 != l_l_op1 + l_l_op2) || (l_l_op1 + l_l_op2 != l_l_op1 + (long)ul_l_op2) || (l_l_op1 + (long)ul_l_op2 != l_l_op1 + f_l_op2) || (l_l_op1 + f_l_op2 != l_l_op1 + d_l_op2) || ((decimal)(l_l_op1 + d_l_op2) != l_l_op1 + m_l_op2) || (l_l_op1 + m_l_op2 != l_l_op1 + i_l_op2) || (l_l_op1 + i_l_op2 != 9))
+ {
+ Console.WriteLine("testcase 9 failed");
+ passed = false;
+ }
+ if ((l_l_op1 + s_s_op2 != l_l_op1 + s_ui_s_op2) || (l_l_op1 + s_ui_s_op2 != l_l_op1 + s_s_op2) || (l_l_op1 + s_s_op2 != l_l_op1 + (long)s_ul_s_op2) || (l_l_op1 + (long)s_ul_s_op2 != l_l_op1 + s_s_op2) || (l_l_op1 + s_s_op2 != l_l_op1 + s_s_op2) || ((decimal)(l_l_op1 + s_s_op2) != l_l_op1 + s_s_op2) || (l_l_op1 + s_s_op2 != l_l_op1 + s_s_op2) || (l_l_op1 + s_s_op2 != 9))
+ {
+ Console.WriteLine("testcase 10 failed");
+ passed = false;
+ }
+ if ((s_s_op1 + i_l_op2 != s_s_op1 + ui_l_op2) || (s_s_op1 + ui_l_op2 != s_s_op1 + l_l_op2) || (s_s_op1 + l_l_op2 != s_s_op1 + (long)ul_l_op2) || (s_s_op1 + (long)ul_l_op2 != s_s_op1 + f_l_op2) || (s_s_op1 + f_l_op2 != s_s_op1 + d_l_op2) || ((decimal)(s_s_op1 + d_l_op2) != s_s_op1 + m_l_op2) || (s_s_op1 + m_l_op2 != s_s_op1 + i_l_op2) || (s_s_op1 + i_l_op2 != 9))
+ {
+ Console.WriteLine("testcase 11 failed");
+ passed = false;
+ }
+ if ((s_s_op1 + s_s_op2 != s_s_op1 + s_ui_s_op2) || (s_s_op1 + s_ui_s_op2 != s_s_op1 + s_s_op2) || (s_s_op1 + s_s_op2 != s_s_op1 + (long)s_ul_s_op2) || (s_s_op1 + (long)s_ul_s_op2 != s_s_op1 + s_s_op2) || (s_s_op1 + s_s_op2 != s_s_op1 + s_s_op2) || ((decimal)(s_s_op1 + s_s_op2) != s_s_op1 + s_s_op2) || (s_s_op1 + s_s_op2 != s_s_op1 + s_s_op2) || (s_s_op1 + s_s_op2 != 9))
+ {
+ Console.WriteLine("testcase 12 failed");
+ passed = false;
+ }
+ }
+
+ {
+ ulong ul_l_op1 = 1;
+ int i_l_op2 = 8;
+ uint ui_l_op2 = 8;
+ long l_l_op2 = 8;
+ ulong ul_l_op2 = 8;
+ float f_l_op2 = 8;
+ double d_l_op2 = 8;
+ decimal m_l_op2 = 8;
+ numHolder nHldr_l_op2 = new numHolder(8);
+ if ((ul_l_op1 + (ulong)i_l_op2 != ul_l_op1 + ui_l_op2) || (ul_l_op1 + ui_l_op2 != ul_l_op1 + (ulong)l_l_op2) || (ul_l_op1 + (ulong)l_l_op2 != ul_l_op1 + ul_l_op2) || (ul_l_op1 + ul_l_op2 != ul_l_op1 + f_l_op2) || (ul_l_op1 + f_l_op2 != ul_l_op1 + d_l_op2) || ((decimal)(ul_l_op1 + d_l_op2) != ul_l_op1 + m_l_op2) || (ul_l_op1 + m_l_op2 != ul_l_op1 + (ulong)i_l_op2) || (ul_l_op1 + (ulong)i_l_op2 != 9))
+ {
+ Console.WriteLine("testcase 13 failed");
+ passed = false;
+ }
+ if ((ul_l_op1 + (ulong)s_s_op2 != ul_l_op1 + s_ui_s_op2) || (ul_l_op1 + s_ui_s_op2 != ul_l_op1 + (ulong)s_s_op2) || (ul_l_op1 + (ulong)s_s_op2 != ul_l_op1 + s_ul_s_op2) || (ul_l_op1 + s_ul_s_op2 != ul_l_op1 + s_s_op2) || (ul_l_op1 + s_s_op2 != ul_l_op1 + s_s_op2) || ((decimal)(ul_l_op1 + s_s_op2) != ul_l_op1 + s_s_op2) || (ul_l_op1 + s_s_op2 != ul_l_op1 + (ulong)s_s_op2) || (ul_l_op1 + (ulong)s_s_op2 != 9))
+ {
+ Console.WriteLine("testcase 14 failed");
+ passed = false;
+ }
+ if ((s_ul_s_op1 + (ulong)i_l_op2 != s_ul_s_op1 + ui_l_op2) || (s_ul_s_op1 + ui_l_op2 != s_ul_s_op1 + (ulong)l_l_op2) || (s_ul_s_op1 + (ulong)l_l_op2 != s_ul_s_op1 + ul_l_op2) || (s_ul_s_op1 + ul_l_op2 != s_ul_s_op1 + f_l_op2) || (s_ul_s_op1 + f_l_op2 != s_ul_s_op1 + d_l_op2) || ((decimal)(s_ul_s_op1 + d_l_op2) != s_ul_s_op1 + m_l_op2) || (s_ul_s_op1 + m_l_op2 != s_ul_s_op1 + (ulong)i_l_op2) || (s_ul_s_op1 + (ulong)i_l_op2 != 9))
+ {
+ Console.WriteLine("testcase 15 failed");
+ passed = false;
+ }
+ if ((s_ul_s_op1 + (ulong)s_s_op2 != s_ul_s_op1 + s_ui_s_op2) || (s_ul_s_op1 + s_ui_s_op2 != s_ul_s_op1 + (ulong)s_s_op2) || (s_ul_s_op1 + (ulong)s_s_op2 != s_ul_s_op1 + s_ul_s_op2) || (s_ul_s_op1 + s_ul_s_op2 != s_ul_s_op1 + s_s_op2) || (s_ul_s_op1 + s_s_op2 != s_ul_s_op1 + s_s_op2) || ((decimal)(s_ul_s_op1 + s_s_op2) != s_ul_s_op1 + s_s_op2) || (s_ul_s_op1 + s_s_op2 != s_ul_s_op1 + (ulong)s_s_op2) || (s_ul_s_op1 + (ulong)s_s_op2 != 9))
+ {
+ Console.WriteLine("testcase 16 failed");
+ passed = false;
+ }
+ }
+
+ {
+ float f_l_op1 = 1;
+ int i_l_op2 = 8;
+ uint ui_l_op2 = 8;
+ long l_l_op2 = 8;
+ ulong ul_l_op2 = 8;
+ float f_l_op2 = 8;
+ double d_l_op2 = 8;
+ decimal m_l_op2 = 8;
+ numHolder nHldr_l_op2 = new numHolder(8);
+ if ((f_l_op1 + i_l_op2 != f_l_op1 + ui_l_op2) || (f_l_op1 + ui_l_op2 != f_l_op1 + l_l_op2) || (f_l_op1 + l_l_op2 != f_l_op1 + ul_l_op2) || (f_l_op1 + ul_l_op2 != f_l_op1 + f_l_op2) || (f_l_op1 + f_l_op2 != f_l_op1 + d_l_op2) || (f_l_op1 + d_l_op2 != f_l_op1 + (float)m_l_op2) || (f_l_op1 + (float)m_l_op2 != f_l_op1 + i_l_op2) || (f_l_op1 + i_l_op2 != 9))
+ {
+ Console.WriteLine("testcase 17 failed");
+ passed = false;
+ }
+ if ((f_l_op1 + s_s_op2 != f_l_op1 + s_ui_s_op2) || (f_l_op1 + s_ui_s_op2 != f_l_op1 + s_s_op2) || (f_l_op1 + s_s_op2 != f_l_op1 + s_ul_s_op2) || (f_l_op1 + s_ul_s_op2 != f_l_op1 + s_s_op2) || (f_l_op1 + s_s_op2 != f_l_op1 + s_s_op2) || (f_l_op1 + s_s_op2 != f_l_op1 + (float)s_s_op2) || (f_l_op1 + (float)s_s_op2 != f_l_op1 + s_s_op2) || (f_l_op1 + s_s_op2 != 9))
+ {
+ Console.WriteLine("testcase 18 failed");
+ passed = false;
+ }
+ if ((s_s_op1 + i_l_op2 != s_s_op1 + ui_l_op2) || (s_s_op1 + ui_l_op2 != s_s_op1 + l_l_op2) || (s_s_op1 + l_l_op2 != s_s_op1 + ul_l_op2) || (s_s_op1 + ul_l_op2 != s_s_op1 + f_l_op2) || (s_s_op1 + f_l_op2 != s_s_op1 + d_l_op2) || (s_s_op1 + d_l_op2 != s_s_op1 + (float)m_l_op2) || (s_s_op1 + (float)m_l_op2 != s_s_op1 + i_l_op2) || (s_s_op1 + i_l_op2 != 9))
+ {
+ Console.WriteLine("testcase 19 failed");
+ passed = false;
+ }
+ if ((s_s_op1 + s_s_op2 != s_s_op1 + s_ui_s_op2) || (s_s_op1 + s_ui_s_op2 != s_s_op1 + s_s_op2) || (s_s_op1 + s_s_op2 != s_s_op1 + s_ul_s_op2) || (s_s_op1 + s_ul_s_op2 != s_s_op1 + s_s_op2) || (s_s_op1 + s_s_op2 != s_s_op1 + s_s_op2) || (s_s_op1 + s_s_op2 != s_s_op1 + (float)s_s_op2) || (s_s_op1 + (float)s_s_op2 != s_s_op1 + s_s_op2) || (s_s_op1 + s_s_op2 != 9))
+ {
+ Console.WriteLine("testcase 20 failed");
+ passed = false;
+ }
+ }
+
+ {
+ double d_l_op1 = 1;
+ int i_l_op2 = 8;
+ uint ui_l_op2 = 8;
+ long l_l_op2 = 8;
+ ulong ul_l_op2 = 8;
+ float f_l_op2 = 8;
+ double d_l_op2 = 8;
+ decimal m_l_op2 = 8;
+ numHolder nHldr_l_op2 = new numHolder(8);
+ if ((d_l_op1 + i_l_op2 != d_l_op1 + ui_l_op2) || (d_l_op1 + ui_l_op2 != d_l_op1 + l_l_op2) || (d_l_op1 + l_l_op2 != d_l_op1 + ul_l_op2) || (d_l_op1 + ul_l_op2 != d_l_op1 + f_l_op2) || (d_l_op1 + f_l_op2 != d_l_op1 + d_l_op2) || (d_l_op1 + d_l_op2 != d_l_op1 + (double)m_l_op2) || (d_l_op1 + (double)m_l_op2 != d_l_op1 + i_l_op2) || (d_l_op1 + i_l_op2 != 9))
+ {
+ Console.WriteLine("testcase 21 failed");
+ passed = false;
+ }
+ if ((d_l_op1 + s_s_op2 != d_l_op1 + s_ui_s_op2) || (d_l_op1 + s_ui_s_op2 != d_l_op1 + s_s_op2) || (d_l_op1 + s_s_op2 != d_l_op1 + s_ul_s_op2) || (d_l_op1 + s_ul_s_op2 != d_l_op1 + s_s_op2) || (d_l_op1 + s_s_op2 != d_l_op1 + s_s_op2) || (d_l_op1 + s_s_op2 != d_l_op1 + (double)s_s_op2) || (d_l_op1 + (double)s_s_op2 != d_l_op1 + s_s_op2) || (d_l_op1 + s_s_op2 != 9))
+ {
+ Console.WriteLine("testcase 22 failed");
+ passed = false;
+ }
+ if ((s_s_op1 + i_l_op2 != s_s_op1 + ui_l_op2) || (s_s_op1 + ui_l_op2 != s_s_op1 + l_l_op2) || (s_s_op1 + l_l_op2 != s_s_op1 + ul_l_op2) || (s_s_op1 + ul_l_op2 != s_s_op1 + f_l_op2) || (s_s_op1 + f_l_op2 != s_s_op1 + d_l_op2) || (s_s_op1 + d_l_op2 != s_s_op1 + (double)m_l_op2) || (s_s_op1 + (double)m_l_op2 != s_s_op1 + i_l_op2) || (s_s_op1 + i_l_op2 != 9))
+ {
+ Console.WriteLine("testcase 23 failed");
+ passed = false;
+ }
+ if ((s_s_op1 + s_s_op2 != s_s_op1 + s_ui_s_op2) || (s_s_op1 + s_ui_s_op2 != s_s_op1 + s_s_op2) || (s_s_op1 + s_s_op2 != s_s_op1 + s_ul_s_op2) || (s_s_op1 + s_ul_s_op2 != s_s_op1 + s_s_op2) || (s_s_op1 + s_s_op2 != s_s_op1 + s_s_op2) || (s_s_op1 + s_s_op2 != s_s_op1 + (double)s_s_op2) || (s_s_op1 + (double)s_s_op2 != s_s_op1 + s_s_op2) || (s_s_op1 + s_s_op2 != 9))
+ {
+ Console.WriteLine("testcase 24 failed");
+ passed = false;
+ }
+ }
+
+ {
+ decimal m_l_op1 = 1;
+ int i_l_op2 = 8;
+ uint ui_l_op2 = 8;
+ long l_l_op2 = 8;
+ ulong ul_l_op2 = 8;
+ float f_l_op2 = 8;
+ double d_l_op2 = 8;
+ decimal m_l_op2 = 8;
+ numHolder nHldr_l_op2 = new numHolder(8);
+ if ((m_l_op1 + i_l_op2 != m_l_op1 + ui_l_op2) || (m_l_op1 + ui_l_op2 != m_l_op1 + l_l_op2) || (m_l_op1 + l_l_op2 != m_l_op1 + ul_l_op2) || (m_l_op1 + ul_l_op2 != m_l_op1 + (decimal)f_l_op2) || (m_l_op1 + (decimal)f_l_op2 != m_l_op1 + (decimal)d_l_op2) || (m_l_op1 + (decimal)d_l_op2 != m_l_op1 + m_l_op2) || (m_l_op1 + m_l_op2 != m_l_op1 + i_l_op2) || (m_l_op1 + i_l_op2 != 9))
+ {
+ Console.WriteLine("testcase 25 failed");
+ passed = false;
+ }
+ if ((m_l_op1 + s_s_op2 != m_l_op1 + s_ui_s_op2) || (m_l_op1 + s_ui_s_op2 != m_l_op1 + s_s_op2) || (m_l_op1 + s_s_op2 != m_l_op1 + s_ul_s_op2) || (m_l_op1 + s_ul_s_op2 != m_l_op1 + (decimal)s_s_op2) || (m_l_op1 + (decimal)s_s_op2 != m_l_op1 + (decimal)s_s_op2) || (m_l_op1 + (decimal)s_s_op2 != m_l_op1 + s_s_op2) || (m_l_op1 + s_s_op2 != m_l_op1 + s_s_op2) || (m_l_op1 + s_s_op2 != 9))
+ {
+ Console.WriteLine("testcase 26 failed");
+ passed = false;
+ }
+ if ((s_s_op1 + i_l_op2 != s_s_op1 + ui_l_op2) || (s_s_op1 + ui_l_op2 != s_s_op1 + l_l_op2) || (s_s_op1 + l_l_op2 != s_s_op1 + ul_l_op2) || (s_s_op1 + ul_l_op2 != s_s_op1 + (decimal)f_l_op2) || (s_s_op1 + (decimal)f_l_op2 != s_s_op1 + (decimal)d_l_op2) || (s_s_op1 + (decimal)d_l_op2 != s_s_op1 + m_l_op2) || (s_s_op1 + m_l_op2 != s_s_op1 + i_l_op2) || (s_s_op1 + i_l_op2 != 9))
+ {
+ Console.WriteLine("testcase 27 failed");
+ passed = false;
+ }
+ if ((s_s_op1 + s_s_op2 != s_s_op1 + s_ui_s_op2) || (s_s_op1 + s_ui_s_op2 != s_s_op1 + s_s_op2) || (s_s_op1 + s_s_op2 != s_s_op1 + s_ul_s_op2) || (s_s_op1 + s_ul_s_op2 != s_s_op1 + (decimal)s_s_op2) || (s_s_op1 + (decimal)s_s_op2 != s_s_op1 + (decimal)s_s_op2) || (s_s_op1 + (decimal)s_s_op2 != s_s_op1 + s_s_op2) || (s_s_op1 + s_s_op2 != s_s_op1 + s_s_op2) || (s_s_op1 + s_s_op2 != 9))
+ {
+ Console.WriteLine("testcase 28 failed");
+ passed = false;
+ }
+ }
+
+ if (!passed)
+ {
+ Console.WriteLine("FAILED");
+ return 1;
+ }
+ else
+ {
+ Console.WriteLine("PASSED");
+ return 100;
+ }
+ }
+}
diff --git a/tests/src/JIT/Directed/coverage/oldtests/lclflddiv.cs b/tests/src/JIT/Directed/coverage/oldtests/lclflddiv.cs
new file mode 100644
index 0000000000..fe81185674
--- /dev/null
+++ b/tests/src/JIT/Directed/coverage/oldtests/lclflddiv.cs
@@ -0,0 +1,559 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+//
+
+//Testing simple math on local vars and fields - div
+
+#pragma warning disable 0414
+using System;
+internal class lclflddiv
+{
+ //user-defined class that overloads operator /
+ public class numHolder
+ {
+ private int _num;
+ private uint _ui_num;
+ private long _num;
+ private ulong _ul_num;
+ private float _num;
+ private double _num;
+ private decimal _num;
+ public numHolder(int i_num)
+ {
+ _num = Convert.ToInt32(i_num);
+ _ui_num = Convert.ToUInt32(i_num);
+ _num = Convert.ToInt64(i_num);
+ _ul_num = Convert.ToUInt64(i_num);
+ _num = Convert.ToSingle(i_num);
+ _num = Convert.ToDouble(i_num);
+ _num = Convert.ToDecimal(i_num);
+ }
+
+ public static int operator /(numHolder a, int b)
+ {
+ return a._num / b;
+ }
+
+ public numHolder(uint ui_num)
+ {
+ _num = Convert.ToInt32(ui_num);
+ _ui_num = Convert.ToUInt32(ui_num);
+ _num = Convert.ToInt64(ui_num);
+ _ul_num = Convert.ToUInt64(ui_num);
+ _num = Convert.ToSingle(ui_num);
+ _num = Convert.ToDouble(ui_num);
+ _num = Convert.ToDecimal(ui_num);
+ }
+
+ public static uint operator /(numHolder a, uint b)
+ {
+ return a._ui_num / b;
+ }
+
+ public numHolder(long l_num)
+ {
+ _num = Convert.ToInt32(l_num);
+ _ui_num = Convert.ToUInt32(l_num);
+ this._num = Convert.ToInt64(l_num);
+ _ul_num = Convert.ToUInt64(l_num);
+ _num = Convert.ToSingle(l_num);
+ _num = Convert.ToDouble(l_num);
+ _num = Convert.ToDecimal(l_num);
+ }
+
+ public static long operator /(numHolder a, long b)
+ {
+ return a._num / b;
+ }
+
+ public numHolder(ulong ul_num)
+ {
+ _num = Convert.ToInt32(ul_num);
+ _ui_num = Convert.ToUInt32(ul_num);
+ _num = Convert.ToInt64(ul_num);
+ _ul_num = Convert.ToUInt64(ul_num);
+ _num = Convert.ToSingle(ul_num);
+ _num = Convert.ToDouble(ul_num);
+ _num = Convert.ToDecimal(ul_num);
+ }
+
+ public static long operator /(numHolder a, ulong b)
+ {
+ return (long)(a._ul_num / b);
+ }
+
+ public numHolder(float f_num)
+ {
+ _num = Convert.ToInt32(f_num);
+ _ui_num = Convert.ToUInt32(f_num);
+ _num = Convert.ToInt64(f_num);
+ _ul_num = Convert.ToUInt64(f_num);
+ this._num = Convert.ToSingle(f_num);
+ _num = Convert.ToDouble(f_num);
+ _num = Convert.ToDecimal(f_num);
+ }
+
+ public static float operator /(numHolder a, float b)
+ {
+ return a._num / b;
+ }
+
+ public numHolder(double d_num)
+ {
+ _num = Convert.ToInt32(d_num);
+ _ui_num = Convert.ToUInt32(d_num);
+ _num = Convert.ToInt64(d_num);
+ _ul_num = Convert.ToUInt64(d_num);
+ _num = Convert.ToSingle(d_num);
+ this._num = Convert.ToDouble(d_num);
+ _num = Convert.ToDecimal(d_num);
+ }
+
+ public static double operator /(numHolder a, double b)
+ {
+ return a._num / b;
+ }
+
+ public numHolder(decimal m_num)
+ {
+ _num = Convert.ToInt32(m_num);
+ _ui_num = Convert.ToUInt32(m_num);
+ _num = Convert.ToInt64(m_num);
+ _ul_num = Convert.ToUInt64(m_num);
+ _num = Convert.ToSingle(m_num);
+ _num = Convert.ToDouble(m_num);
+ this._num = Convert.ToDecimal(m_num);
+ }
+
+ public static int operator /(numHolder a, decimal b)
+ {
+ return (int)(a._num / b);
+ }
+
+ public static int operator /(numHolder a, numHolder b)
+ {
+ return a._num / b._num;
+ }
+ }
+
+ private static int s_s_op1 = 128;
+ private static uint s_ui_s_op1 = 128;
+ private static long s_s_op1 = 128;
+ private static ulong s_ul_s_op1 = 128;
+ private static float s_s_op1 = 128;
+ private static double s_s_op1 = 128;
+ private static decimal s_s_op1 = 128;
+
+ private static int s_s_op2 = 4;
+ private static uint s_ui_s_op2 = 4;
+ private static long s_s_op2 = 4;
+ private static ulong s_ul_s_op2 = 4;
+ private static float s_s_op2 = 4;
+ private static double s_s_op2 = 4;
+ private static decimal s_s_op2 = 4;
+ private static numHolder s_nHldr_s_op2 = new numHolder(4);
+
+ public static int i_f(String s)
+ {
+ if (s == "op1")
+ return 128;
+ else
+ return 4;
+ }
+ public static uint ui_f(String s)
+ {
+ if (s == "op1")
+ return 128;
+ else
+ return 4;
+ }
+ public static long l_f(String s)
+ {
+ if (s == "op1")
+ return 128;
+ else
+ return 4;
+ }
+ public static ulong ul_f(String s)
+ {
+ if (s == "op1")
+ return 128;
+ else
+ return 4;
+ }
+ public static float f_f(String s)
+ {
+ if (s == "op1")
+ return 128;
+ else
+ return 4;
+ }
+ public static double d_f(String s)
+ {
+ if (s == "op1")
+ return 128;
+ else
+ return 4;
+ }
+ public static decimal m_f(String s)
+ {
+ if (s == "op1")
+ return 128;
+ else
+ return 4;
+ }
+ public static numHolder nHldr_f(String s)
+ {
+ if (s == "op1")
+ return new numHolder(128);
+ else
+ return new numHolder(4);
+ }
+ private class CL
+ {
+ public int i_cl_op1 = 128;
+ public uint ui_cl_op1 = 128;
+ public long l_cl_op1 = 128;
+ public ulong ul_cl_op1 = 128;
+ public float f_cl_op1 = 128;
+ public double d_cl_op1 = 128;
+ public decimal m_cl_op1 = 128;
+
+ public int i_cl_op2 = 4;
+ public uint ui_cl_op2 = 4;
+ public long l_cl_op2 = 4;
+ public ulong ul_cl_op2 = 4;
+ public float f_cl_op2 = 4;
+ public double d_cl_op2 = 4;
+ public decimal m_cl_op2 = 4;
+ public numHolder nHldr_cl_op2 = new numHolder(4);
+ }
+
+ private struct VT
+ {
+ public int i_vt_op1;
+ public uint ui_vt_op1;
+ public long l_vt_op1;
+ public ulong ul_vt_op1;
+ public float f_vt_op1;
+ public double d_vt_op1;
+ public decimal m_vt_op1;
+
+ public int i_vt_op2;
+ public uint ui_vt_op2;
+ public long l_vt_op2;
+ public ulong ul_vt_op2;
+ public float f_vt_op2;
+ public double d_vt_op2;
+ public decimal m_vt_op2;
+ public numHolder nHldr_vt_op2;
+ }
+
+ public static int Main()
+ {
+ bool passed = true;
+ //initialize class
+ CL cl1 = new CL();
+ //initialize struct
+ VT vt1;
+ vt1.i_vt_op1 = 128;
+ vt1.ui_vt_op1 = 128;
+ vt1.l_vt_op1 = 128;
+ vt1.ul_vt_op1 = 128;
+ vt1.f_vt_op1 = 128;
+ vt1.d_vt_op1 = 128;
+ vt1.m_vt_op1 = 128;
+ vt1.i_vt_op2 = 4;
+ vt1.ui_vt_op2 = 4;
+ vt1.l_vt_op2 = 4;
+ vt1.ul_vt_op2 = 4;
+ vt1.f_vt_op2 = 4;
+ vt1.d_vt_op2 = 4;
+ vt1.m_vt_op2 = 4;
+ vt1.nHldr_vt_op2 = new numHolder(4);
+
+ int[] i_arr1d_op1 = { 0, 128 };
+ int[,] i_arr2d_op1 = { { 0, 128 }, { 1, 1 } };
+ int[,,] i_arr3d_op1 = { { { 0, 128 }, { 1, 1 } } };
+ uint[] ui_arr1d_op1 = { 0, 128 };
+ uint[,] ui_arr2d_op1 = { { 0, 128 }, { 1, 1 } };
+ uint[,,] ui_arr3d_op1 = { { { 0, 128 }, { 1, 1 } } };
+ long[] l_arr1d_op1 = { 0, 128 };
+ long[,] l_arr2d_op1 = { { 0, 128 }, { 1, 1 } };
+ long[,,] l_arr3d_op1 = { { { 0, 128 }, { 1, 1 } } };
+ ulong[] ul_arr1d_op1 = { 0, 128 };
+ ulong[,] ul_arr2d_op1 = { { 0, 128 }, { 1, 1 } };
+ ulong[,,] ul_arr3d_op1 = { { { 0, 128 }, { 1, 1 } } };
+ float[] f_arr1d_op1 = { 0, 128 };
+ float[,] f_arr2d_op1 = { { 0, 128 }, { 1, 1 } };
+ float[,,] f_arr3d_op1 = { { { 0, 128 }, { 1, 1 } } };
+ double[] d_arr1d_op1 = { 0, 128 };
+ double[,] d_arr2d_op1 = { { 0, 128 }, { 1, 1 } };
+ double[,,] d_arr3d_op1 = { { { 0, 128 }, { 1, 1 } } };
+ decimal[] m_arr1d_op1 = { 0, 128 };
+ decimal[,] m_arr2d_op1 = { { 0, 128 }, { 1, 1 } };
+ decimal[,,] m_arr3d_op1 = { { { 0, 128 }, { 1, 1 } } };
+
+ int[] i_arr1d_op2 = { 4, 0, 1 };
+ int[,] i_arr2d_op2 = { { 0, 4 }, { 1, 1 } };
+ int[,,] i_arr3d_op2 = { { { 0, 4 }, { 1, 1 } } };
+ uint[] ui_arr1d_op2 = { 4, 0, 1 };
+ uint[,] ui_arr2d_op2 = { { 0, 4 }, { 1, 1 } };
+ uint[,,] ui_arr3d_op2 = { { { 0, 4 }, { 1, 1 } } };
+ long[] l_arr1d_op2 = { 4, 0, 1 };
+ long[,] l_arr2d_op2 = { { 0, 4 }, { 1, 1 } };
+ long[,,] l_arr3d_op2 = { { { 0, 4 }, { 1, 1 } } };
+ ulong[] ul_arr1d_op2 = { 4, 0, 1 };
+ ulong[,] ul_arr2d_op2 = { { 0, 4 }, { 1, 1 } };
+ ulong[,,] ul_arr3d_op2 = { { { 0, 4 }, { 1, 1 } } };
+ float[] f_arr1d_op2 = { 4, 0, 1 };
+ float[,] f_arr2d_op2 = { { 0, 4 }, { 1, 1 } };
+ float[,,] f_arr3d_op2 = { { { 0, 4 }, { 1, 1 } } };
+ double[] d_arr1d_op2 = { 4, 0, 1 };
+ double[,] d_arr2d_op2 = { { 0, 4 }, { 1, 1 } };
+ double[,,] d_arr3d_op2 = { { { 0, 4 }, { 1, 1 } } };
+ decimal[] m_arr1d_op2 = { 4, 0, 1 };
+ decimal[,] m_arr2d_op2 = { { 0, 4 }, { 1, 1 } };
+ decimal[,,] m_arr3d_op2 = { { { 0, 4 }, { 1, 1 } } };
+ numHolder[] nHldr_arr1d_op2 = { new numHolder(4), new numHolder(0), new numHolder(1) };
+ numHolder[,] nHldr_arr2d_op2 = { { new numHolder(0), new numHolder(4) }, { new numHolder(1), new numHolder(1) } };
+ numHolder[,,] nHldr_arr3d_op2 = { { { new numHolder(0), new numHolder(4) }, { new numHolder(1), new numHolder(1) } } };
+
+ int[,] index = { { 0, 0 }, { 1, 1 } };
+
+ {
+ int i_l_op1 = 128;
+ int i_l_op2 = 4;
+ uint ui_l_op2 = 4;
+ long l_l_op2 = 4;
+ ulong ul_l_op2 = 4;
+ float f_l_op2 = 4;
+ double d_l_op2 = 4;
+ decimal m_l_op2 = 4;
+ numHolder nHldr_l_op2 = new numHolder(4);
+ if ((i_l_op1 / i_l_op2 != i_l_op1 / ui_l_op2) || (i_l_op1 / ui_l_op2 != i_l_op1 / l_l_op2) || (i_l_op1 / l_l_op2 != i_l_op1 / (int)ul_l_op2) || (i_l_op1 / (int)ul_l_op2 != i_l_op1 / f_l_op2) || (i_l_op1 / f_l_op2 != i_l_op1 / d_l_op2) || ((decimal)(i_l_op1 / d_l_op2) != i_l_op1 / m_l_op2) || (i_l_op1 / m_l_op2 != i_l_op1 / i_l_op2) || (i_l_op1 / i_l_op2 != 32))
+ {
+ Console.WriteLine("testcase 1 failed");
+ passed = false;
+ }
+ if ((i_l_op1 / s_s_op2 != i_l_op1 / s_ui_s_op2) || (i_l_op1 / s_ui_s_op2 != i_l_op1 / s_s_op2) || (i_l_op1 / s_s_op2 != i_l_op1 / (int)s_ul_s_op2) || (i_l_op1 / (int)s_ul_s_op2 != i_l_op1 / s_s_op2) || (i_l_op1 / s_s_op2 != i_l_op1 / s_s_op2) || ((decimal)(i_l_op1 / s_s_op2) != i_l_op1 / s_s_op2) || (i_l_op1 / s_s_op2 != i_l_op1 / s_s_op2) || (i_l_op1 / s_s_op2 != 32))
+ {
+ Console.WriteLine("testcase 2 failed");
+ passed = false;
+ }
+ if ((s_s_op1 / i_l_op2 != s_s_op1 / ui_l_op2) || (s_s_op1 / ui_l_op2 != s_s_op1 / l_l_op2) || (s_s_op1 / l_l_op2 != s_s_op1 / (int)ul_l_op2) || (s_s_op1 / (int)ul_l_op2 != s_s_op1 / f_l_op2) || (s_s_op1 / f_l_op2 != s_s_op1 / d_l_op2) || ((decimal)(s_s_op1 / d_l_op2) != s_s_op1 / m_l_op2) || (s_s_op1 / m_l_op2 != s_s_op1 / i_l_op2) || (s_s_op1 / i_l_op2 != 32))
+ {
+ Console.WriteLine("testcase 3 failed");
+ passed = false;
+ }
+ if ((s_s_op1 / s_s_op2 != s_s_op1 / s_ui_s_op2) || (s_s_op1 / s_ui_s_op2 != s_s_op1 / s_s_op2) || (s_s_op1 / s_s_op2 != s_s_op1 / (int)s_ul_s_op2) || (s_s_op1 / (int)s_ul_s_op2 != s_s_op1 / s_s_op2) || (s_s_op1 / s_s_op2 != s_s_op1 / s_s_op2) || ((decimal)(s_s_op1 / s_s_op2) != s_s_op1 / s_s_op2) || (s_s_op1 / s_s_op2 != s_s_op1 / s_s_op2) || (s_s_op1 / s_s_op2 != 32))
+ {
+ Console.WriteLine("testcase 4 failed");
+ passed = false;
+ }
+ }
+
+ {
+ uint ui_l_op1 = 128;
+ int i_l_op2 = 4;
+ uint ui_l_op2 = 4;
+ long l_l_op2 = 4;
+ ulong ul_l_op2 = 4;
+ float f_l_op2 = 4;
+ double d_l_op2 = 4;
+ decimal m_l_op2 = 4;
+ numHolder nHldr_l_op2 = new numHolder(4);
+ if ((ui_l_op1 / i_l_op2 != ui_l_op1 / ui_l_op2) || (ui_l_op1 / ui_l_op2 != ui_l_op1 / l_l_op2) || ((ulong)(ui_l_op1 / l_l_op2) != ui_l_op1 / ul_l_op2) || (ui_l_op1 / ul_l_op2 != ui_l_op1 / f_l_op2) || (ui_l_op1 / f_l_op2 != ui_l_op1 / d_l_op2) || ((decimal)(ui_l_op1 / d_l_op2) != ui_l_op1 / m_l_op2) || (ui_l_op1 / m_l_op2 != ui_l_op1 / i_l_op2) || (ui_l_op1 / i_l_op2 != 32))
+ {
+ Console.WriteLine("testcase 5 failed");
+ passed = false;
+ }
+ if ((ui_l_op1 / s_s_op2 != ui_l_op1 / s_ui_s_op2) || (ui_l_op1 / s_ui_s_op2 != ui_l_op1 / s_s_op2) || ((ulong)(ui_l_op1 / s_s_op2) != ui_l_op1 / s_ul_s_op2) || (ui_l_op1 / s_ul_s_op2 != ui_l_op1 / s_s_op2) || (ui_l_op1 / s_s_op2 != ui_l_op1 / s_s_op2) || ((decimal)(ui_l_op1 / s_s_op2) != ui_l_op1 / s_s_op2) || (ui_l_op1 / s_s_op2 != ui_l_op1 / s_s_op2) || (ui_l_op1 / s_s_op2 != 32))
+ {
+ Console.WriteLine("testcase 6 failed");
+ passed = false;
+ }
+ if ((s_ui_s_op1 / i_l_op2 != s_ui_s_op1 / ui_l_op2) || (s_ui_s_op1 / ui_l_op2 != s_ui_s_op1 / l_l_op2) || ((ulong)(s_ui_s_op1 / l_l_op2) != s_ui_s_op1 / ul_l_op2) || (s_ui_s_op1 / ul_l_op2 != s_ui_s_op1 / f_l_op2) || (s_ui_s_op1 / f_l_op2 != s_ui_s_op1 / d_l_op2) || ((decimal)(s_ui_s_op1 / d_l_op2) != s_ui_s_op1 / m_l_op2) || (s_ui_s_op1 / m_l_op2 != s_ui_s_op1 / i_l_op2) || (s_ui_s_op1 / i_l_op2 != 32))
+ {
+ Console.WriteLine("testcase 7 failed");
+ passed = false;
+ }
+ if ((s_ui_s_op1 / s_s_op2 != s_ui_s_op1 / s_ui_s_op2) || (s_ui_s_op1 / s_ui_s_op2 != s_ui_s_op1 / s_s_op2) || ((ulong)(s_ui_s_op1 / s_s_op2) != s_ui_s_op1 / s_ul_s_op2) || (s_ui_s_op1 / s_ul_s_op2 != s_ui_s_op1 / s_s_op2) || (s_ui_s_op1 / s_s_op2 != s_ui_s_op1 / s_s_op2) || ((decimal)(s_ui_s_op1 / s_s_op2) != s_ui_s_op1 / s_s_op2) || (s_ui_s_op1 / s_s_op2 != s_ui_s_op1 / s_s_op2) || (s_ui_s_op1 / s_s_op2 != 32))
+ {
+ Console.WriteLine("testcase 8 failed");
+ passed = false;
+ }
+ }
+
+ {
+ long l_l_op1 = 128;
+ int i_l_op2 = 4;
+ uint ui_l_op2 = 4;
+ long l_l_op2 = 4;
+ ulong ul_l_op2 = 4;
+ float f_l_op2 = 4;
+ double d_l_op2 = 4;
+ decimal m_l_op2 = 4;
+ numHolder nHldr_l_op2 = new numHolder(4);
+ if ((l_l_op1 / i_l_op2 != l_l_op1 / ui_l_op2) || (l_l_op1 / ui_l_op2 != l_l_op1 / l_l_op2) || (l_l_op1 / l_l_op2 != l_l_op1 / (long)ul_l_op2) || (l_l_op1 / (long)ul_l_op2 != l_l_op1 / f_l_op2) || (l_l_op1 / f_l_op2 != l_l_op1 / d_l_op2) || ((decimal)(l_l_op1 / d_l_op2) != l_l_op1 / m_l_op2) || (l_l_op1 / m_l_op2 != l_l_op1 / i_l_op2) || (l_l_op1 / i_l_op2 != 32))
+ {
+ Console.WriteLine("testcase 9 failed");
+ passed = false;
+ }
+ if ((l_l_op1 / s_s_op2 != l_l_op1 / s_ui_s_op2) || (l_l_op1 / s_ui_s_op2 != l_l_op1 / s_s_op2) || (l_l_op1 / s_s_op2 != l_l_op1 / (long)s_ul_s_op2) || (l_l_op1 / (long)s_ul_s_op2 != l_l_op1 / s_s_op2) || (l_l_op1 / s_s_op2 != l_l_op1 / s_s_op2) || ((decimal)(l_l_op1 / s_s_op2) != l_l_op1 / s_s_op2) || (l_l_op1 / s_s_op2 != l_l_op1 / s_s_op2) || (l_l_op1 / s_s_op2 != 32))
+ {
+ Console.WriteLine("testcase 10 failed");
+ passed = false;
+ }
+ if ((s_s_op1 / i_l_op2 != s_s_op1 / ui_l_op2) || (s_s_op1 / ui_l_op2 != s_s_op1 / l_l_op2) || (s_s_op1 / l_l_op2 != s_s_op1 / (long)ul_l_op2) || (s_s_op1 / (long)ul_l_op2 != s_s_op1 / f_l_op2) || (s_s_op1 / f_l_op2 != s_s_op1 / d_l_op2) || ((decimal)(s_s_op1 / d_l_op2) != s_s_op1 / m_l_op2) || (s_s_op1 / m_l_op2 != s_s_op1 / i_l_op2) || (s_s_op1 / i_l_op2 != 32))
+ {
+ Console.WriteLine("testcase 11 failed");
+ passed = false;
+ }
+ if ((s_s_op1 / s_s_op2 != s_s_op1 / s_ui_s_op2) || (s_s_op1 / s_ui_s_op2 != s_s_op1 / s_s_op2) || (s_s_op1 / s_s_op2 != s_s_op1 / (long)s_ul_s_op2) || (s_s_op1 / (long)s_ul_s_op2 != s_s_op1 / s_s_op2) || (s_s_op1 / s_s_op2 != s_s_op1 / s_s_op2) || ((decimal)(s_s_op1 / s_s_op2) != s_s_op1 / s_s_op2) || (s_s_op1 / s_s_op2 != s_s_op1 / s_s_op2) || (s_s_op1 / s_s_op2 != 32))
+ {
+ Console.WriteLine("testcase 12 failed");
+ passed = false;
+ }
+ }
+
+ {
+ ulong ul_l_op1 = 128;
+ int i_l_op2 = 4;
+ uint ui_l_op2 = 4;
+ long l_l_op2 = 4;
+ ulong ul_l_op2 = 4;
+ float f_l_op2 = 4;
+ double d_l_op2 = 4;
+ decimal m_l_op2 = 4;
+ numHolder nHldr_l_op2 = new numHolder(4);
+ if ((ul_l_op1 / (ulong)i_l_op2 != ul_l_op1 / ui_l_op2) || (ul_l_op1 / ui_l_op2 != ul_l_op1 / (ulong)l_l_op2) || (ul_l_op1 / (ulong)l_l_op2 != ul_l_op1 / ul_l_op2) || (ul_l_op1 / ul_l_op2 != ul_l_op1 / f_l_op2) || (ul_l_op1 / f_l_op2 != ul_l_op1 / d_l_op2) || ((decimal)(ul_l_op1 / d_l_op2) != ul_l_op1 / m_l_op2) || (ul_l_op1 / m_l_op2 != ul_l_op1 / (ulong)i_l_op2) || (ul_l_op1 / (ulong)i_l_op2 != 32))
+ {
+ Console.WriteLine("testcase 13 failed");
+ passed = false;
+ }
+ if ((ul_l_op1 / (ulong)s_s_op2 != ul_l_op1 / s_ui_s_op2) || (ul_l_op1 / s_ui_s_op2 != ul_l_op1 / (ulong)s_s_op2) || (ul_l_op1 / (ulong)s_s_op2 != ul_l_op1 / s_ul_s_op2) || (ul_l_op1 / s_ul_s_op2 != ul_l_op1 / s_s_op2) || (ul_l_op1 / s_s_op2 != ul_l_op1 / s_s_op2) || ((decimal)(ul_l_op1 / s_s_op2) != ul_l_op1 / s_s_op2) || (ul_l_op1 / s_s_op2 != ul_l_op1 / (ulong)s_s_op2) || (ul_l_op1 / (ulong)s_s_op2 != 32))
+ {
+ Console.WriteLine("testcase 14 failed");
+ passed = false;
+ }
+ if ((s_ul_s_op1 / (ulong)i_l_op2 != s_ul_s_op1 / ui_l_op2) || (s_ul_s_op1 / ui_l_op2 != s_ul_s_op1 / (ulong)l_l_op2) || (s_ul_s_op1 / (ulong)l_l_op2 != s_ul_s_op1 / ul_l_op2) || (s_ul_s_op1 / ul_l_op2 != s_ul_s_op1 / f_l_op2) || (s_ul_s_op1 / f_l_op2 != s_ul_s_op1 / d_l_op2) || ((decimal)(s_ul_s_op1 / d_l_op2) != s_ul_s_op1 / m_l_op2) || (s_ul_s_op1 / m_l_op2 != s_ul_s_op1 / (ulong)i_l_op2) || (s_ul_s_op1 / (ulong)i_l_op2 != 32))
+ {
+ Console.WriteLine("testcase 15 failed");
+ passed = false;
+ }
+ if ((s_ul_s_op1 / (ulong)s_s_op2 != s_ul_s_op1 / s_ui_s_op2) || (s_ul_s_op1 / s_ui_s_op2 != s_ul_s_op1 / (ulong)s_s_op2) || (s_ul_s_op1 / (ulong)s_s_op2 != s_ul_s_op1 / s_ul_s_op2) || (s_ul_s_op1 / s_ul_s_op2 != s_ul_s_op1 / s_s_op2) || (s_ul_s_op1 / s_s_op2 != s_ul_s_op1 / s_s_op2) || ((decimal)(s_ul_s_op1 / s_s_op2) != s_ul_s_op1 / s_s_op2) || (s_ul_s_op1 / s_s_op2 != s_ul_s_op1 / (ulong)s_s_op2) || (s_ul_s_op1 / (ulong)s_s_op2 != 32))
+ {
+ Console.WriteLine("testcase 16 failed");
+ passed = false;
+ }
+ }
+
+ {
+ float f_l_op1 = 128;
+ int i_l_op2 = 4;
+ uint ui_l_op2 = 4;
+ long l_l_op2 = 4;
+ ulong ul_l_op2 = 4;
+ float f_l_op2 = 4;
+ double d_l_op2 = 4;
+ decimal m_l_op2 = 4;
+ numHolder nHldr_l_op2 = new numHolder(4);
+ if ((f_l_op1 / i_l_op2 != f_l_op1 / ui_l_op2) || (f_l_op1 / ui_l_op2 != f_l_op1 / l_l_op2) || (f_l_op1 / l_l_op2 != f_l_op1 / ul_l_op2) || (f_l_op1 / ul_l_op2 != f_l_op1 / f_l_op2) || (f_l_op1 / f_l_op2 != f_l_op1 / d_l_op2) || (f_l_op1 / d_l_op2 != f_l_op1 / (float)m_l_op2) || (f_l_op1 / (float)m_l_op2 != f_l_op1 / i_l_op2) || (f_l_op1 / i_l_op2 != 32))
+ {
+ Console.WriteLine("testcase 17 failed");
+ passed = false;
+ }
+ if ((f_l_op1 / s_s_op2 != f_l_op1 / s_ui_s_op2) || (f_l_op1 / s_ui_s_op2 != f_l_op1 / s_s_op2) || (f_l_op1 / s_s_op2 != f_l_op1 / s_ul_s_op2) || (f_l_op1 / s_ul_s_op2 != f_l_op1 / s_s_op2) || (f_l_op1 / s_s_op2 != f_l_op1 / s_s_op2) || (f_l_op1 / s_s_op2 != f_l_op1 / (float)s_s_op2) || (f_l_op1 / (float)s_s_op2 != f_l_op1 / s_s_op2) || (f_l_op1 / s_s_op2 != 32))
+ {
+ Console.WriteLine("testcase 18 failed");
+ passed = false;
+ }
+ if ((s_s_op1 / i_l_op2 != s_s_op1 / ui_l_op2) || (s_s_op1 / ui_l_op2 != s_s_op1 / l_l_op2) || (s_s_op1 / l_l_op2 != s_s_op1 / ul_l_op2) || (s_s_op1 / ul_l_op2 != s_s_op1 / f_l_op2) || (s_s_op1 / f_l_op2 != s_s_op1 / d_l_op2) || (s_s_op1 / d_l_op2 != s_s_op1 / (float)m_l_op2) || (s_s_op1 / (float)m_l_op2 != s_s_op1 / i_l_op2) || (s_s_op1 / i_l_op2 != 32))
+ {
+ Console.WriteLine("testcase 19 failed");
+ passed = false;
+ }
+ if ((s_s_op1 / s_s_op2 != s_s_op1 / s_ui_s_op2) || (s_s_op1 / s_ui_s_op2 != s_s_op1 / s_s_op2) || (s_s_op1 / s_s_op2 != s_s_op1 / s_ul_s_op2) || (s_s_op1 / s_ul_s_op2 != s_s_op1 / s_s_op2) || (s_s_op1 / s_s_op2 != s_s_op1 / s_s_op2) || (s_s_op1 / s_s_op2 != s_s_op1 / (float)s_s_op2) || (s_s_op1 / (float)s_s_op2 != s_s_op1 / s_s_op2) || (s_s_op1 / s_s_op2 != 32))
+ {
+ Console.WriteLine("testcase 20 failed");
+ passed = false;
+ }
+ }
+
+ {
+ double d_l_op1 = 128;
+ int i_l_op2 = 4;
+ uint ui_l_op2 = 4;
+ long l_l_op2 = 4;
+ ulong ul_l_op2 = 4;
+ float f_l_op2 = 4;
+ double d_l_op2 = 4;
+ decimal m_l_op2 = 4;
+ numHolder nHldr_l_op2 = new numHolder(4);
+ if ((d_l_op1 / i_l_op2 != d_l_op1 / ui_l_op2) || (d_l_op1 / ui_l_op2 != d_l_op1 / l_l_op2) || (d_l_op1 / l_l_op2 != d_l_op1 / ul_l_op2) || (d_l_op1 / ul_l_op2 != d_l_op1 / f_l_op2) || (d_l_op1 / f_l_op2 != d_l_op1 / d_l_op2) || (d_l_op1 / d_l_op2 != d_l_op1 / (double)m_l_op2) || (d_l_op1 / (double)m_l_op2 != d_l_op1 / i_l_op2) || (d_l_op1 / i_l_op2 != 32))
+ {
+ Console.WriteLine("testcase 21 failed");
+ passed = false;
+ }
+ if ((d_l_op1 / s_s_op2 != d_l_op1 / s_ui_s_op2) || (d_l_op1 / s_ui_s_op2 != d_l_op1 / s_s_op2) || (d_l_op1 / s_s_op2 != d_l_op1 / s_ul_s_op2) || (d_l_op1 / s_ul_s_op2 != d_l_op1 / s_s_op2) || (d_l_op1 / s_s_op2 != d_l_op1 / s_s_op2) || (d_l_op1 / s_s_op2 != d_l_op1 / (double)s_s_op2) || (d_l_op1 / (double)s_s_op2 != d_l_op1 / s_s_op2) || (d_l_op1 / s_s_op2 != 32))
+ {
+ Console.WriteLine("testcase 22 failed");
+ passed = false;
+ }
+ if ((s_s_op1 / i_l_op2 != s_s_op1 / ui_l_op2) || (s_s_op1 / ui_l_op2 != s_s_op1 / l_l_op2) || (s_s_op1 / l_l_op2 != s_s_op1 / ul_l_op2) || (s_s_op1 / ul_l_op2 != s_s_op1 / f_l_op2) || (s_s_op1 / f_l_op2 != s_s_op1 / d_l_op2) || (s_s_op1 / d_l_op2 != s_s_op1 / (double)m_l_op2) || (s_s_op1 / (double)m_l_op2 != s_s_op1 / i_l_op2) || (s_s_op1 / i_l_op2 != 32))
+ {
+ Console.WriteLine("testcase 23 failed");
+ passed = false;
+ }
+ if ((s_s_op1 / s_s_op2 != s_s_op1 / s_ui_s_op2) || (s_s_op1 / s_ui_s_op2 != s_s_op1 / s_s_op2) || (s_s_op1 / s_s_op2 != s_s_op1 / s_ul_s_op2) || (s_s_op1 / s_ul_s_op2 != s_s_op1 / s_s_op2) || (s_s_op1 / s_s_op2 != s_s_op1 / s_s_op2) || (s_s_op1 / s_s_op2 != s_s_op1 / (double)s_s_op2) || (s_s_op1 / (double)s_s_op2 != s_s_op1 / s_s_op2) || (s_s_op1 / s_s_op2 != 32))
+ {
+ Console.WriteLine("testcase 24 failed");
+ passed = false;
+ }
+ }
+
+ {
+ decimal m_l_op1 = 128;
+ int i_l_op2 = 4;
+ uint ui_l_op2 = 4;
+ long l_l_op2 = 4;
+ ulong ul_l_op2 = 4;
+ float f_l_op2 = 4;
+ double d_l_op2 = 4;
+ decimal m_l_op2 = 4;
+ numHolder nHldr_l_op2 = new numHolder(4);
+ if ((m_l_op1 / i_l_op2 != m_l_op1 / ui_l_op2) || (m_l_op1 / ui_l_op2 != m_l_op1 / l_l_op2) || (m_l_op1 / l_l_op2 != m_l_op1 / ul_l_op2) || (m_l_op1 / ul_l_op2 != m_l_op1 / (decimal)f_l_op2) || (m_l_op1 / (decimal)f_l_op2 != m_l_op1 / (decimal)d_l_op2) || (m_l_op1 / (decimal)d_l_op2 != m_l_op1 / m_l_op2) || (m_l_op1 / m_l_op2 != m_l_op1 / i_l_op2) || (m_l_op1 / i_l_op2 != 32))
+ {
+ Console.WriteLine("testcase 25 failed");
+ passed = false;
+ }
+ if ((m_l_op1 / s_s_op2 != m_l_op1 / s_ui_s_op2) || (m_l_op1 / s_ui_s_op2 != m_l_op1 / s_s_op2) || (m_l_op1 / s_s_op2 != m_l_op1 / s_ul_s_op2) || (m_l_op1 / s_ul_s_op2 != m_l_op1 / (decimal)s_s_op2) || (m_l_op1 / (decimal)s_s_op2 != m_l_op1 / (decimal)s_s_op2) || (m_l_op1 / (decimal)s_s_op2 != m_l_op1 / s_s_op2) || (m_l_op1 / s_s_op2 != m_l_op1 / s_s_op2) || (m_l_op1 / s_s_op2 != 32))
+ {
+ Console.WriteLine("testcase 26 failed");
+ passed = false;
+ }
+ if ((s_s_op1 / i_l_op2 != s_s_op1 / ui_l_op2) || (s_s_op1 / ui_l_op2 != s_s_op1 / l_l_op2) || (s_s_op1 / l_l_op2 != s_s_op1 / ul_l_op2) || (s_s_op1 / ul_l_op2 != s_s_op1 / (decimal)f_l_op2) || (s_s_op1 / (decimal)f_l_op2 != s_s_op1 / (decimal)d_l_op2) || (s_s_op1 / (decimal)d_l_op2 != s_s_op1 / m_l_op2) || (s_s_op1 / m_l_op2 != s_s_op1 / i_l_op2) || (s_s_op1 / i_l_op2 != 32))
+ {
+ Console.WriteLine("testcase 27 failed");
+ passed = false;
+ }
+ if ((s_s_op1 / s_s_op2 != s_s_op1 / s_ui_s_op2) || (s_s_op1 / s_ui_s_op2 != s_s_op1 / s_s_op2) || (s_s_op1 / s_s_op2 != s_s_op1 / s_ul_s_op2) || (s_s_op1 / s_ul_s_op2 != s_s_op1 / (decimal)s_s_op2) || (s_s_op1 / (decimal)s_s_op2 != s_s_op1 / (decimal)s_s_op2) || (s_s_op1 / (decimal)s_s_op2 != s_s_op1 / s_s_op2) || (s_s_op1 / s_s_op2 != s_s_op1 / s_s_op2) || (s_s_op1 / s_s_op2 != 32))
+ {
+ Console.WriteLine("testcase 28 failed");
+ passed = false;
+ }
+ }
+
+ if (!passed)
+ {
+ Console.WriteLine("FAILED");
+ return 1;
+ }
+ else
+ {
+ Console.WriteLine("PASSED");
+ return 100;
+ }
+ }
+}
diff --git a/tests/src/JIT/Directed/coverage/oldtests/lclfldmul.cs b/tests/src/JIT/Directed/coverage/oldtests/lclfldmul.cs
new file mode 100644
index 0000000000..f781b13469
--- /dev/null
+++ b/tests/src/JIT/Directed/coverage/oldtests/lclfldmul.cs
@@ -0,0 +1,559 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+//
+
+//Testing simple math on local vars and fields - mul
+
+#pragma warning disable 0414
+using System;
+internal class lclfldmul
+{
+ //user-defined class that overloads operator *
+ public class numHolder
+ {
+ private int _num;
+ private uint _ui_num;
+ private long _num;
+ private ulong _ul_num;
+ private float _num;
+ private double _num;
+ private decimal _num;
+ public numHolder(int i_num)
+ {
+ _num = Convert.ToInt32(i_num);
+ _ui_num = Convert.ToUInt32(i_num);
+ _num = Convert.ToInt64(i_num);
+ _ul_num = Convert.ToUInt64(i_num);
+ _num = Convert.ToSingle(i_num);
+ _num = Convert.ToDouble(i_num);
+ _num = Convert.ToDecimal(i_num);
+ }
+
+ public static int operator *(numHolder a, int b)
+ {
+ return a._num * b;
+ }
+
+ public numHolder(uint ui_num)
+ {
+ _num = Convert.ToInt32(ui_num);
+ _ui_num = Convert.ToUInt32(ui_num);
+ _num = Convert.ToInt64(ui_num);
+ _ul_num = Convert.ToUInt64(ui_num);
+ _num = Convert.ToSingle(ui_num);
+ _num = Convert.ToDouble(ui_num);
+ _num = Convert.ToDecimal(ui_num);
+ }
+
+ public static uint operator *(numHolder a, uint b)
+ {
+ return a._ui_num * b;
+ }
+
+ public numHolder(long l_num)
+ {
+ _num = Convert.ToInt32(l_num);
+ _ui_num = Convert.ToUInt32(l_num);
+ this._num = Convert.ToInt64(l_num);
+ _ul_num = Convert.ToUInt64(l_num);
+ _num = Convert.ToSingle(l_num);
+ _num = Convert.ToDouble(l_num);
+ _num = Convert.ToDecimal(l_num);
+ }
+
+ public static long operator *(numHolder a, long b)
+ {
+ return a._num * b;
+ }
+
+ public numHolder(ulong ul_num)
+ {
+ _num = Convert.ToInt32(ul_num);
+ _ui_num = Convert.ToUInt32(ul_num);
+ _num = Convert.ToInt64(ul_num);
+ _ul_num = Convert.ToUInt64(ul_num);
+ _num = Convert.ToSingle(ul_num);
+ _num = Convert.ToDouble(ul_num);
+ _num = Convert.ToDecimal(ul_num);
+ }
+
+ public static long operator *(numHolder a, ulong b)
+ {
+ return (long)(a._ul_num * b);
+ }
+
+ public numHolder(float f_num)
+ {
+ _num = Convert.ToInt32(f_num);
+ _ui_num = Convert.ToUInt32(f_num);
+ _num = Convert.ToInt64(f_num);
+ _ul_num = Convert.ToUInt64(f_num);
+ this._num = Convert.ToSingle(f_num);
+ _num = Convert.ToDouble(f_num);
+ _num = Convert.ToDecimal(f_num);
+ }
+
+ public static float operator *(numHolder a, float b)
+ {
+ return a._num * b;
+ }
+
+ public numHolder(double d_num)
+ {
+ _num = Convert.ToInt32(d_num);
+ _ui_num = Convert.ToUInt32(d_num);
+ _num = Convert.ToInt64(d_num);
+ _ul_num = Convert.ToUInt64(d_num);
+ _num = Convert.ToSingle(d_num);
+ this._num = Convert.ToDouble(d_num);
+ _num = Convert.ToDecimal(d_num);
+ }
+
+ public static double operator *(numHolder a, double b)
+ {
+ return a._num * b;
+ }
+
+ public numHolder(decimal m_num)
+ {
+ _num = Convert.ToInt32(m_num);
+ _ui_num = Convert.ToUInt32(m_num);
+ _num = Convert.ToInt64(m_num);
+ _ul_num = Convert.ToUInt64(m_num);
+ _num = Convert.ToSingle(m_num);
+ _num = Convert.ToDouble(m_num);
+ this._num = Convert.ToDecimal(m_num);
+ }
+
+ public static int operator *(numHolder a, decimal b)
+ {
+ return (int)(a._num * b);
+ }
+
+ public static int operator *(numHolder a, numHolder b)
+ {
+ return a._num * b._num;
+ }
+ }
+
+ private static int s_s_op1 = 3;
+ private static uint s_ui_s_op1 = 3;
+ private static long s_s_op1 = 3;
+ private static ulong s_ul_s_op1 = 3;
+ private static float s_s_op1 = 3;
+ private static double s_s_op1 = 3;
+ private static decimal s_s_op1 = 3;
+
+ private static int s_s_op2 = 7;
+ private static uint s_ui_s_op2 = 7;
+ private static long s_s_op2 = 7;
+ private static ulong s_ul_s_op2 = 7;
+ private static float s_s_op2 = 7;
+ private static double s_s_op2 = 7;
+ private static decimal s_s_op2 = 7;
+ private static numHolder s_nHldr_s_op2 = new numHolder(7);
+
+ public static int i_f(String s)
+ {
+ if (s == "op1")
+ return 3;
+ else
+ return 7;
+ }
+ public static uint ui_f(String s)
+ {
+ if (s == "op1")
+ return 3;
+ else
+ return 7;
+ }
+ public static long l_f(String s)
+ {
+ if (s == "op1")
+ return 3;
+ else
+ return 7;
+ }
+ public static ulong ul_f(String s)
+ {
+ if (s == "op1")
+ return 3;
+ else
+ return 7;
+ }
+ public static float f_f(String s)
+ {
+ if (s == "op1")
+ return 3;
+ else
+ return 7;
+ }
+ public static double d_f(String s)
+ {
+ if (s == "op1")
+ return 3;
+ else
+ return 7;
+ }
+ public static decimal m_f(String s)
+ {
+ if (s == "op1")
+ return 3;
+ else
+ return 7;
+ }
+ public static numHolder nHldr_f(String s)
+ {
+ if (s == "op1")
+ return new numHolder(3);
+ else
+ return new numHolder(7);
+ }
+ private class CL
+ {
+ public int i_cl_op1 = 3;
+ public uint ui_cl_op1 = 3;
+ public long l_cl_op1 = 3;
+ public ulong ul_cl_op1 = 3;
+ public float f_cl_op1 = 3;
+ public double d_cl_op1 = 3;
+ public decimal m_cl_op1 = 3;
+
+ public int i_cl_op2 = 7;
+ public uint ui_cl_op2 = 7;
+ public long l_cl_op2 = 7;
+ public ulong ul_cl_op2 = 7;
+ public float f_cl_op2 = 7;
+ public double d_cl_op2 = 7;
+ public decimal m_cl_op2 = 7;
+ public numHolder nHldr_cl_op2 = new numHolder(7);
+ }
+
+ private struct VT
+ {
+ public int i_vt_op1;
+ public uint ui_vt_op1;
+ public long l_vt_op1;
+ public ulong ul_vt_op1;
+ public float f_vt_op1;
+ public double d_vt_op1;
+ public decimal m_vt_op1;
+
+ public int i_vt_op2;
+ public uint ui_vt_op2;
+ public long l_vt_op2;
+ public ulong ul_vt_op2;
+ public float f_vt_op2;
+ public double d_vt_op2;
+ public decimal m_vt_op2;
+ public numHolder nHldr_vt_op2;
+ }
+
+ public static int Main()
+ {
+ bool passed = true;
+ //initialize class
+ CL cl1 = new CL();
+ //initialize struct
+ VT vt1;
+ vt1.i_vt_op1 = 3;
+ vt1.ui_vt_op1 = 3;
+ vt1.l_vt_op1 = 3;
+ vt1.ul_vt_op1 = 3;
+ vt1.f_vt_op1 = 3;
+ vt1.d_vt_op1 = 3;
+ vt1.m_vt_op1 = 3;
+ vt1.i_vt_op2 = 7;
+ vt1.ui_vt_op2 = 7;
+ vt1.l_vt_op2 = 7;
+ vt1.ul_vt_op2 = 7;
+ vt1.f_vt_op2 = 7;
+ vt1.d_vt_op2 = 7;
+ vt1.m_vt_op2 = 7;
+ vt1.nHldr_vt_op2 = new numHolder(7);
+
+ int[] i_arr1d_op1 = { 0, 3 };
+ int[,] i_arr2d_op1 = { { 0, 3 }, { 1, 1 } };
+ int[,,] i_arr3d_op1 = { { { 0, 3 }, { 1, 1 } } };
+ uint[] ui_arr1d_op1 = { 0, 3 };
+ uint[,] ui_arr2d_op1 = { { 0, 3 }, { 1, 1 } };
+ uint[,,] ui_arr3d_op1 = { { { 0, 3 }, { 1, 1 } } };
+ long[] l_arr1d_op1 = { 0, 3 };
+ long[,] l_arr2d_op1 = { { 0, 3 }, { 1, 1 } };
+ long[,,] l_arr3d_op1 = { { { 0, 3 }, { 1, 1 } } };
+ ulong[] ul_arr1d_op1 = { 0, 3 };
+ ulong[,] ul_arr2d_op1 = { { 0, 3 }, { 1, 1 } };
+ ulong[,,] ul_arr3d_op1 = { { { 0, 3 }, { 1, 1 } } };
+ float[] f_arr1d_op1 = { 0, 3 };
+ float[,] f_arr2d_op1 = { { 0, 3 }, { 1, 1 } };
+ float[,,] f_arr3d_op1 = { { { 0, 3 }, { 1, 1 } } };
+ double[] d_arr1d_op1 = { 0, 3 };
+ double[,] d_arr2d_op1 = { { 0, 3 }, { 1, 1 } };
+ double[,,] d_arr3d_op1 = { { { 0, 3 }, { 1, 1 } } };
+ decimal[] m_arr1d_op1 = { 0, 3 };
+ decimal[,] m_arr2d_op1 = { { 0, 3 }, { 1, 1 } };
+ decimal[,,] m_arr3d_op1 = { { { 0, 3 }, { 1, 1 } } };
+
+ int[] i_arr1d_op2 = { 7, 0, 1 };
+ int[,] i_arr2d_op2 = { { 0, 7 }, { 1, 1 } };
+ int[,,] i_arr3d_op2 = { { { 0, 7 }, { 1, 1 } } };
+ uint[] ui_arr1d_op2 = { 7, 0, 1 };
+ uint[,] ui_arr2d_op2 = { { 0, 7 }, { 1, 1 } };
+ uint[,,] ui_arr3d_op2 = { { { 0, 7 }, { 1, 1 } } };
+ long[] l_arr1d_op2 = { 7, 0, 1 };
+ long[,] l_arr2d_op2 = { { 0, 7 }, { 1, 1 } };
+ long[,,] l_arr3d_op2 = { { { 0, 7 }, { 1, 1 } } };
+ ulong[] ul_arr1d_op2 = { 7, 0, 1 };
+ ulong[,] ul_arr2d_op2 = { { 0, 7 }, { 1, 1 } };
+ ulong[,,] ul_arr3d_op2 = { { { 0, 7 }, { 1, 1 } } };
+ float[] f_arr1d_op2 = { 7, 0, 1 };
+ float[,] f_arr2d_op2 = { { 0, 7 }, { 1, 1 } };
+ float[,,] f_arr3d_op2 = { { { 0, 7 }, { 1, 1 } } };
+ double[] d_arr1d_op2 = { 7, 0, 1 };
+ double[,] d_arr2d_op2 = { { 0, 7 }, { 1, 1 } };
+ double[,,] d_arr3d_op2 = { { { 0, 7 }, { 1, 1 } } };
+ decimal[] m_arr1d_op2 = { 7, 0, 1 };
+ decimal[,] m_arr2d_op2 = { { 0, 7 }, { 1, 1 } };
+ decimal[,,] m_arr3d_op2 = { { { 0, 7 }, { 1, 1 } } };
+ numHolder[] nHldr_arr1d_op2 = { new numHolder(7), new numHolder(0), new numHolder(1) };
+ numHolder[,] nHldr_arr2d_op2 = { { new numHolder(0), new numHolder(7) }, { new numHolder(1), new numHolder(1) } };
+ numHolder[,,] nHldr_arr3d_op2 = { { { new numHolder(0), new numHolder(7) }, { new numHolder(1), new numHolder(1) } } };
+
+ int[,] index = { { 0, 0 }, { 1, 1 } };
+
+ {
+ int i_l_op1 = 3;
+ int i_l_op2 = 7;
+ uint ui_l_op2 = 7;
+ long l_l_op2 = 7;
+ ulong ul_l_op2 = 7;
+ float f_l_op2 = 7;
+ double d_l_op2 = 7;
+ decimal m_l_op2 = 7;
+ numHolder nHldr_l_op2 = new numHolder(7);
+ if ((i_l_op1 * i_l_op2 != i_l_op1 * ui_l_op2) || (i_l_op1 * ui_l_op2 != i_l_op1 * l_l_op2) || (i_l_op1 * l_l_op2 != i_l_op1 * (int)ul_l_op2) || (i_l_op1 * (int)ul_l_op2 != i_l_op1 * f_l_op2) || (i_l_op1 * f_l_op2 != i_l_op1 * d_l_op2) || ((decimal)(i_l_op1 * d_l_op2) != i_l_op1 * m_l_op2) || (i_l_op1 * m_l_op2 != i_l_op1 * i_l_op2) || (i_l_op1 * i_l_op2 != 21))
+ {
+ Console.WriteLine("testcase 1 failed");
+ passed = false;
+ }
+ if ((i_l_op1 * s_s_op2 != i_l_op1 * s_ui_s_op2) || (i_l_op1 * s_ui_s_op2 != i_l_op1 * s_s_op2) || (i_l_op1 * s_s_op2 != i_l_op1 * (int)s_ul_s_op2) || (i_l_op1 * (int)s_ul_s_op2 != i_l_op1 * s_s_op2) || (i_l_op1 * s_s_op2 != i_l_op1 * s_s_op2) || ((decimal)(i_l_op1 * s_s_op2) != i_l_op1 * s_s_op2) || (i_l_op1 * s_s_op2 != i_l_op1 * s_s_op2) || (i_l_op1 * s_s_op2 != 21))
+ {
+ Console.WriteLine("testcase 2 failed");
+ passed = false;
+ }
+ if ((s_s_op1 * i_l_op2 != s_s_op1 * ui_l_op2) || (s_s_op1 * ui_l_op2 != s_s_op1 * l_l_op2) || (s_s_op1 * l_l_op2 != s_s_op1 * (int)ul_l_op2) || (s_s_op1 * (int)ul_l_op2 != s_s_op1 * f_l_op2) || (s_s_op1 * f_l_op2 != s_s_op1 * d_l_op2) || ((decimal)(s_s_op1 * d_l_op2) != s_s_op1 * m_l_op2) || (s_s_op1 * m_l_op2 != s_s_op1 * i_l_op2) || (s_s_op1 * i_l_op2 != 21))
+ {
+ Console.WriteLine("testcase 3 failed");
+ passed = false;
+ }
+ if ((s_s_op1 * s_s_op2 != s_s_op1 * s_ui_s_op2) || (s_s_op1 * s_ui_s_op2 != s_s_op1 * s_s_op2) || (s_s_op1 * s_s_op2 != s_s_op1 * (int)s_ul_s_op2) || (s_s_op1 * (int)s_ul_s_op2 != s_s_op1 * s_s_op2) || (s_s_op1 * s_s_op2 != s_s_op1 * s_s_op2) || ((decimal)(s_s_op1 * s_s_op2) != s_s_op1 * s_s_op2) || (s_s_op1 * s_s_op2 != s_s_op1 * s_s_op2) || (s_s_op1 * s_s_op2 != 21))
+ {
+ Console.WriteLine("testcase 4 failed");
+ passed = false;
+ }
+ }
+
+ {
+ uint ui_l_op1 = 3;
+ int i_l_op2 = 7;
+ uint ui_l_op2 = 7;
+ long l_l_op2 = 7;
+ ulong ul_l_op2 = 7;
+ float f_l_op2 = 7;
+ double d_l_op2 = 7;
+ decimal m_l_op2 = 7;
+ numHolder nHldr_l_op2 = new numHolder(7);
+ if ((ui_l_op1 * i_l_op2 != ui_l_op1 * ui_l_op2) || (ui_l_op1 * ui_l_op2 != ui_l_op1 * l_l_op2) || ((ulong)(ui_l_op1 * l_l_op2) != ui_l_op1 * ul_l_op2) || (ui_l_op1 * ul_l_op2 != ui_l_op1 * f_l_op2) || (ui_l_op1 * f_l_op2 != ui_l_op1 * d_l_op2) || ((decimal)(ui_l_op1 * d_l_op2) != ui_l_op1 * m_l_op2) || (ui_l_op1 * m_l_op2 != ui_l_op1 * i_l_op2) || (ui_l_op1 * i_l_op2 != 21))
+ {
+ Console.WriteLine("testcase 5 failed");
+ passed = false;
+ }
+ if ((ui_l_op1 * s_s_op2 != ui_l_op1 * s_ui_s_op2) || (ui_l_op1 * s_ui_s_op2 != ui_l_op1 * s_s_op2) || ((ulong)(ui_l_op1 * s_s_op2) != ui_l_op1 * s_ul_s_op2) || (ui_l_op1 * s_ul_s_op2 != ui_l_op1 * s_s_op2) || (ui_l_op1 * s_s_op2 != ui_l_op1 * s_s_op2) || ((decimal)(ui_l_op1 * s_s_op2) != ui_l_op1 * s_s_op2) || (ui_l_op1 * s_s_op2 != ui_l_op1 * s_s_op2) || (ui_l_op1 * s_s_op2 != 21))
+ {
+ Console.WriteLine("testcase 6 failed");
+ passed = false;
+ }
+ if ((s_ui_s_op1 * i_l_op2 != s_ui_s_op1 * ui_l_op2) || (s_ui_s_op1 * ui_l_op2 != s_ui_s_op1 * l_l_op2) || ((ulong)(s_ui_s_op1 * l_l_op2) != s_ui_s_op1 * ul_l_op2) || (s_ui_s_op1 * ul_l_op2 != s_ui_s_op1 * f_l_op2) || (s_ui_s_op1 * f_l_op2 != s_ui_s_op1 * d_l_op2) || ((decimal)(s_ui_s_op1 * d_l_op2) != s_ui_s_op1 * m_l_op2) || (s_ui_s_op1 * m_l_op2 != s_ui_s_op1 * i_l_op2) || (s_ui_s_op1 * i_l_op2 != 21))
+ {
+ Console.WriteLine("testcase 7 failed");
+ passed = false;
+ }
+ if ((s_ui_s_op1 * s_s_op2 != s_ui_s_op1 * s_ui_s_op2) || (s_ui_s_op1 * s_ui_s_op2 != s_ui_s_op1 * s_s_op2) || ((ulong)(s_ui_s_op1 * s_s_op2) != s_ui_s_op1 * s_ul_s_op2) || (s_ui_s_op1 * s_ul_s_op2 != s_ui_s_op1 * s_s_op2) || (s_ui_s_op1 * s_s_op2 != s_ui_s_op1 * s_s_op2) || ((decimal)(s_ui_s_op1 * s_s_op2) != s_ui_s_op1 * s_s_op2) || (s_ui_s_op1 * s_s_op2 != s_ui_s_op1 * s_s_op2) || (s_ui_s_op1 * s_s_op2 != 21))
+ {
+ Console.WriteLine("testcase 8 failed");
+ passed = false;
+ }
+ }
+
+ {
+ long l_l_op1 = 3;
+ int i_l_op2 = 7;
+ uint ui_l_op2 = 7;
+ long l_l_op2 = 7;
+ ulong ul_l_op2 = 7;
+ float f_l_op2 = 7;
+ double d_l_op2 = 7;
+ decimal m_l_op2 = 7;
+ numHolder nHldr_l_op2 = new numHolder(7);
+ if ((l_l_op1 * i_l_op2 != l_l_op1 * ui_l_op2) || (l_l_op1 * ui_l_op2 != l_l_op1 * l_l_op2) || (l_l_op1 * l_l_op2 != l_l_op1 * (long)ul_l_op2) || (l_l_op1 * (long)ul_l_op2 != l_l_op1 * f_l_op2) || (l_l_op1 * f_l_op2 != l_l_op1 * d_l_op2) || ((decimal)(l_l_op1 * d_l_op2) != l_l_op1 * m_l_op2) || (l_l_op1 * m_l_op2 != l_l_op1 * i_l_op2) || (l_l_op1 * i_l_op2 != 21))
+ {
+ Console.WriteLine("testcase 9 failed");
+ passed = false;
+ }
+ if ((l_l_op1 * s_s_op2 != l_l_op1 * s_ui_s_op2) || (l_l_op1 * s_ui_s_op2 != l_l_op1 * s_s_op2) || (l_l_op1 * s_s_op2 != l_l_op1 * (long)s_ul_s_op2) || (l_l_op1 * (long)s_ul_s_op2 != l_l_op1 * s_s_op2) || (l_l_op1 * s_s_op2 != l_l_op1 * s_s_op2) || ((decimal)(l_l_op1 * s_s_op2) != l_l_op1 * s_s_op2) || (l_l_op1 * s_s_op2 != l_l_op1 * s_s_op2) || (l_l_op1 * s_s_op2 != 21))
+ {
+ Console.WriteLine("testcase 10 failed");
+ passed = false;
+ }
+ if ((s_s_op1 * i_l_op2 != s_s_op1 * ui_l_op2) || (s_s_op1 * ui_l_op2 != s_s_op1 * l_l_op2) || (s_s_op1 * l_l_op2 != s_s_op1 * (long)ul_l_op2) || (s_s_op1 * (long)ul_l_op2 != s_s_op1 * f_l_op2) || (s_s_op1 * f_l_op2 != s_s_op1 * d_l_op2) || ((decimal)(s_s_op1 * d_l_op2) != s_s_op1 * m_l_op2) || (s_s_op1 * m_l_op2 != s_s_op1 * i_l_op2) || (s_s_op1 * i_l_op2 != 21))
+ {
+ Console.WriteLine("testcase 11 failed");
+ passed = false;
+ }
+ if ((s_s_op1 * s_s_op2 != s_s_op1 * s_ui_s_op2) || (s_s_op1 * s_ui_s_op2 != s_s_op1 * s_s_op2) || (s_s_op1 * s_s_op2 != s_s_op1 * (long)s_ul_s_op2) || (s_s_op1 * (long)s_ul_s_op2 != s_s_op1 * s_s_op2) || (s_s_op1 * s_s_op2 != s_s_op1 * s_s_op2) || ((decimal)(s_s_op1 * s_s_op2) != s_s_op1 * s_s_op2) || (s_s_op1 * s_s_op2 != s_s_op1 * s_s_op2) || (s_s_op1 * s_s_op2 != 21))
+ {
+ Console.WriteLine("testcase 12 failed");
+ passed = false;
+ }
+ }
+
+ {
+ ulong ul_l_op1 = 3;
+ int i_l_op2 = 7;
+ uint ui_l_op2 = 7;
+ long l_l_op2 = 7;
+ ulong ul_l_op2 = 7;
+ float f_l_op2 = 7;
+ double d_l_op2 = 7;
+ decimal m_l_op2 = 7;
+ numHolder nHldr_l_op2 = new numHolder(7);
+ if ((ul_l_op1 * (ulong)i_l_op2 != ul_l_op1 * ui_l_op2) || (ul_l_op1 * ui_l_op2 != ul_l_op1 * (ulong)l_l_op2) || (ul_l_op1 * (ulong)l_l_op2 != ul_l_op1 * ul_l_op2) || (ul_l_op1 * ul_l_op2 != ul_l_op1 * f_l_op2) || (ul_l_op1 * f_l_op2 != ul_l_op1 * d_l_op2) || ((decimal)(ul_l_op1 * d_l_op2) != ul_l_op1 * m_l_op2) || (ul_l_op1 * m_l_op2 != ul_l_op1 * (ulong)i_l_op2) || (ul_l_op1 * (ulong)i_l_op2 != 21))
+ {
+ Console.WriteLine("testcase 13 failed");
+ passed = false;
+ }
+ if ((ul_l_op1 * (ulong)s_s_op2 != ul_l_op1 * s_ui_s_op2) || (ul_l_op1 * s_ui_s_op2 != ul_l_op1 * (ulong)s_s_op2) || (ul_l_op1 * (ulong)s_s_op2 != ul_l_op1 * s_ul_s_op2) || (ul_l_op1 * s_ul_s_op2 != ul_l_op1 * s_s_op2) || (ul_l_op1 * s_s_op2 != ul_l_op1 * s_s_op2) || ((decimal)(ul_l_op1 * s_s_op2) != ul_l_op1 * s_s_op2) || (ul_l_op1 * s_s_op2 != ul_l_op1 * (ulong)s_s_op2) || (ul_l_op1 * (ulong)s_s_op2 != 21))
+ {
+ Console.WriteLine("testcase 14 failed");
+ passed = false;
+ }
+ if ((s_ul_s_op1 * (ulong)i_l_op2 != s_ul_s_op1 * ui_l_op2) || (s_ul_s_op1 * ui_l_op2 != s_ul_s_op1 * (ulong)l_l_op2) || (s_ul_s_op1 * (ulong)l_l_op2 != s_ul_s_op1 * ul_l_op2) || (s_ul_s_op1 * ul_l_op2 != s_ul_s_op1 * f_l_op2) || (s_ul_s_op1 * f_l_op2 != s_ul_s_op1 * d_l_op2) || ((decimal)(s_ul_s_op1 * d_l_op2) != s_ul_s_op1 * m_l_op2) || (s_ul_s_op1 * m_l_op2 != s_ul_s_op1 * (ulong)i_l_op2) || (s_ul_s_op1 * (ulong)i_l_op2 != 21))
+ {
+ Console.WriteLine("testcase 15 failed");
+ passed = false;
+ }
+ if ((s_ul_s_op1 * (ulong)s_s_op2 != s_ul_s_op1 * s_ui_s_op2) || (s_ul_s_op1 * s_ui_s_op2 != s_ul_s_op1 * (ulong)s_s_op2) || (s_ul_s_op1 * (ulong)s_s_op2 != s_ul_s_op1 * s_ul_s_op2) || (s_ul_s_op1 * s_ul_s_op2 != s_ul_s_op1 * s_s_op2) || (s_ul_s_op1 * s_s_op2 != s_ul_s_op1 * s_s_op2) || ((decimal)(s_ul_s_op1 * s_s_op2) != s_ul_s_op1 * s_s_op2) || (s_ul_s_op1 * s_s_op2 != s_ul_s_op1 * (ulong)s_s_op2) || (s_ul_s_op1 * (ulong)s_s_op2 != 21))
+ {
+ Console.WriteLine("testcase 16 failed");
+ passed = false;
+ }
+ }
+
+ {
+ float f_l_op1 = 3;
+ int i_l_op2 = 7;
+ uint ui_l_op2 = 7;
+ long l_l_op2 = 7;
+ ulong ul_l_op2 = 7;
+ float f_l_op2 = 7;
+ double d_l_op2 = 7;
+ decimal m_l_op2 = 7;
+ numHolder nHldr_l_op2 = new numHolder(7);
+ if ((f_l_op1 * i_l_op2 != f_l_op1 * ui_l_op2) || (f_l_op1 * ui_l_op2 != f_l_op1 * l_l_op2) || (f_l_op1 * l_l_op2 != f_l_op1 * ul_l_op2) || (f_l_op1 * ul_l_op2 != f_l_op1 * f_l_op2) || (f_l_op1 * f_l_op2 != f_l_op1 * d_l_op2) || (f_l_op1 * d_l_op2 != f_l_op1 * (float)m_l_op2) || (f_l_op1 * (float)m_l_op2 != f_l_op1 * i_l_op2) || (f_l_op1 * i_l_op2 != 21))
+ {
+ Console.WriteLine("testcase 17 failed");
+ passed = false;
+ }
+ if ((f_l_op1 * s_s_op2 != f_l_op1 * s_ui_s_op2) || (f_l_op1 * s_ui_s_op2 != f_l_op1 * s_s_op2) || (f_l_op1 * s_s_op2 != f_l_op1 * s_ul_s_op2) || (f_l_op1 * s_ul_s_op2 != f_l_op1 * s_s_op2) || (f_l_op1 * s_s_op2 != f_l_op1 * s_s_op2) || (f_l_op1 * s_s_op2 != f_l_op1 * (float)s_s_op2) || (f_l_op1 * (float)s_s_op2 != f_l_op1 * s_s_op2) || (f_l_op1 * s_s_op2 != 21))
+ {
+ Console.WriteLine("testcase 18 failed");
+ passed = false;
+ }
+ if ((s_s_op1 * i_l_op2 != s_s_op1 * ui_l_op2) || (s_s_op1 * ui_l_op2 != s_s_op1 * l_l_op2) || (s_s_op1 * l_l_op2 != s_s_op1 * ul_l_op2) || (s_s_op1 * ul_l_op2 != s_s_op1 * f_l_op2) || (s_s_op1 * f_l_op2 != s_s_op1 * d_l_op2) || (s_s_op1 * d_l_op2 != s_s_op1 * (float)m_l_op2) || (s_s_op1 * (float)m_l_op2 != s_s_op1 * i_l_op2) || (s_s_op1 * i_l_op2 != 21))
+ {
+ Console.WriteLine("testcase 19 failed");
+ passed = false;
+ }
+ if ((s_s_op1 * s_s_op2 != s_s_op1 * s_ui_s_op2) || (s_s_op1 * s_ui_s_op2 != s_s_op1 * s_s_op2) || (s_s_op1 * s_s_op2 != s_s_op1 * s_ul_s_op2) || (s_s_op1 * s_ul_s_op2 != s_s_op1 * s_s_op2) || (s_s_op1 * s_s_op2 != s_s_op1 * s_s_op2) || (s_s_op1 * s_s_op2 != s_s_op1 * (float)s_s_op2) || (s_s_op1 * (float)s_s_op2 != s_s_op1 * s_s_op2) || (s_s_op1 * s_s_op2 != 21))
+ {
+ Console.WriteLine("testcase 20 failed");
+ passed = false;
+ }
+ }
+
+ {
+ double d_l_op1 = 3;
+ int i_l_op2 = 7;
+ uint ui_l_op2 = 7;
+ long l_l_op2 = 7;
+ ulong ul_l_op2 = 7;
+ float f_l_op2 = 7;
+ double d_l_op2 = 7;
+ decimal m_l_op2 = 7;
+ numHolder nHldr_l_op2 = new numHolder(7);
+ if ((d_l_op1 * i_l_op2 != d_l_op1 * ui_l_op2) || (d_l_op1 * ui_l_op2 != d_l_op1 * l_l_op2) || (d_l_op1 * l_l_op2 != d_l_op1 * ul_l_op2) || (d_l_op1 * ul_l_op2 != d_l_op1 * f_l_op2) || (d_l_op1 * f_l_op2 != d_l_op1 * d_l_op2) || (d_l_op1 * d_l_op2 != d_l_op1 * (double)m_l_op2) || (d_l_op1 * (double)m_l_op2 != d_l_op1 * i_l_op2) || (d_l_op1 * i_l_op2 != 21))
+ {
+ Console.WriteLine("testcase 21 failed");
+ passed = false;
+ }
+ if ((d_l_op1 * s_s_op2 != d_l_op1 * s_ui_s_op2) || (d_l_op1 * s_ui_s_op2 != d_l_op1 * s_s_op2) || (d_l_op1 * s_s_op2 != d_l_op1 * s_ul_s_op2) || (d_l_op1 * s_ul_s_op2 != d_l_op1 * s_s_op2) || (d_l_op1 * s_s_op2 != d_l_op1 * s_s_op2) || (d_l_op1 * s_s_op2 != d_l_op1 * (double)s_s_op2) || (d_l_op1 * (double)s_s_op2 != d_l_op1 * s_s_op2) || (d_l_op1 * s_s_op2 != 21))
+ {
+ Console.WriteLine("testcase 22 failed");
+ passed = false;
+ }
+ if ((s_s_op1 * i_l_op2 != s_s_op1 * ui_l_op2) || (s_s_op1 * ui_l_op2 != s_s_op1 * l_l_op2) || (s_s_op1 * l_l_op2 != s_s_op1 * ul_l_op2) || (s_s_op1 * ul_l_op2 != s_s_op1 * f_l_op2) || (s_s_op1 * f_l_op2 != s_s_op1 * d_l_op2) || (s_s_op1 * d_l_op2 != s_s_op1 * (double)m_l_op2) || (s_s_op1 * (double)m_l_op2 != s_s_op1 * i_l_op2) || (s_s_op1 * i_l_op2 != 21))
+ {
+ Console.WriteLine("testcase 23 failed");
+ passed = false;
+ }
+ if ((s_s_op1 * s_s_op2 != s_s_op1 * s_ui_s_op2) || (s_s_op1 * s_ui_s_op2 != s_s_op1 * s_s_op2) || (s_s_op1 * s_s_op2 != s_s_op1 * s_ul_s_op2) || (s_s_op1 * s_ul_s_op2 != s_s_op1 * s_s_op2) || (s_s_op1 * s_s_op2 != s_s_op1 * s_s_op2) || (s_s_op1 * s_s_op2 != s_s_op1 * (double)s_s_op2) || (s_s_op1 * (double)s_s_op2 != s_s_op1 * s_s_op2) || (s_s_op1 * s_s_op2 != 21))
+ {
+ Console.WriteLine("testcase 24 failed");
+ passed = false;
+ }
+ }
+
+ {
+ decimal m_l_op1 = 3;
+ int i_l_op2 = 7;
+ uint ui_l_op2 = 7;
+ long l_l_op2 = 7;
+ ulong ul_l_op2 = 7;
+ float f_l_op2 = 7;
+ double d_l_op2 = 7;
+ decimal m_l_op2 = 7;
+ numHolder nHldr_l_op2 = new numHolder(7);
+ if ((m_l_op1 * i_l_op2 != m_l_op1 * ui_l_op2) || (m_l_op1 * ui_l_op2 != m_l_op1 * l_l_op2) || (m_l_op1 * l_l_op2 != m_l_op1 * ul_l_op2) || (m_l_op1 * ul_l_op2 != m_l_op1 * (decimal)f_l_op2) || (m_l_op1 * (decimal)f_l_op2 != m_l_op1 * (decimal)d_l_op2) || (m_l_op1 * (decimal)d_l_op2 != m_l_op1 * m_l_op2) || (m_l_op1 * m_l_op2 != m_l_op1 * i_l_op2) || (m_l_op1 * i_l_op2 != 21))
+ {
+ Console.WriteLine("testcase 25 failed");
+ passed = false;
+ }
+ if ((m_l_op1 * s_s_op2 != m_l_op1 * s_ui_s_op2) || (m_l_op1 * s_ui_s_op2 != m_l_op1 * s_s_op2) || (m_l_op1 * s_s_op2 != m_l_op1 * s_ul_s_op2) || (m_l_op1 * s_ul_s_op2 != m_l_op1 * (decimal)s_s_op2) || (m_l_op1 * (decimal)s_s_op2 != m_l_op1 * (decimal)s_s_op2) || (m_l_op1 * (decimal)s_s_op2 != m_l_op1 * s_s_op2) || (m_l_op1 * s_s_op2 != m_l_op1 * s_s_op2) || (m_l_op1 * s_s_op2 != 21))
+ {
+ Console.WriteLine("testcase 26 failed");
+ passed = false;
+ }
+ if ((s_s_op1 * i_l_op2 != s_s_op1 * ui_l_op2) || (s_s_op1 * ui_l_op2 != s_s_op1 * l_l_op2) || (s_s_op1 * l_l_op2 != s_s_op1 * ul_l_op2) || (s_s_op1 * ul_l_op2 != s_s_op1 * (decimal)f_l_op2) || (s_s_op1 * (decimal)f_l_op2 != s_s_op1 * (decimal)d_l_op2) || (s_s_op1 * (decimal)d_l_op2 != s_s_op1 * m_l_op2) || (s_s_op1 * m_l_op2 != s_s_op1 * i_l_op2) || (s_s_op1 * i_l_op2 != 21))
+ {
+ Console.WriteLine("testcase 27 failed");
+ passed = false;
+ }
+ if ((s_s_op1 * s_s_op2 != s_s_op1 * s_ui_s_op2) || (s_s_op1 * s_ui_s_op2 != s_s_op1 * s_s_op2) || (s_s_op1 * s_s_op2 != s_s_op1 * s_ul_s_op2) || (s_s_op1 * s_ul_s_op2 != s_s_op1 * (decimal)s_s_op2) || (s_s_op1 * (decimal)s_s_op2 != s_s_op1 * (decimal)s_s_op2) || (s_s_op1 * (decimal)s_s_op2 != s_s_op1 * s_s_op2) || (s_s_op1 * s_s_op2 != s_s_op1 * s_s_op2) || (s_s_op1 * s_s_op2 != 21))
+ {
+ Console.WriteLine("testcase 28 failed");
+ passed = false;
+ }
+ }
+
+ if (!passed)
+ {
+ Console.WriteLine("FAILED");
+ return 1;
+ }
+ else
+ {
+ Console.WriteLine("PASSED");
+ return 100;
+ }
+ }
+}
diff --git a/tests/src/JIT/Directed/coverage/oldtests/lclfldrem.cs b/tests/src/JIT/Directed/coverage/oldtests/lclfldrem.cs
new file mode 100644
index 0000000000..587ad791e1
--- /dev/null
+++ b/tests/src/JIT/Directed/coverage/oldtests/lclfldrem.cs
@@ -0,0 +1,559 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+//
+
+//Testing simple math on local vars and fields - rem
+
+#pragma warning disable 0414
+using System;
+internal class lclfldrem
+{
+ //user-defined class that overloads operator %
+ public class numHolder
+ {
+ private int _num;
+ private uint _ui_num;
+ private long _num;
+ private ulong _ul_num;
+ private float _num;
+ private double _num;
+ private decimal _num;
+ public numHolder(int i_num)
+ {
+ _num = Convert.ToInt32(i_num);
+ _ui_num = Convert.ToUInt32(i_num);
+ _num = Convert.ToInt64(i_num);
+ _ul_num = Convert.ToUInt64(i_num);
+ _num = Convert.ToSingle(i_num);
+ _num = Convert.ToDouble(i_num);
+ _num = Convert.ToDecimal(i_num);
+ }
+
+ public static int operator %(numHolder a, int b)
+ {
+ return a._num % b;
+ }
+
+ public numHolder(uint ui_num)
+ {
+ _num = Convert.ToInt32(ui_num);
+ _ui_num = Convert.ToUInt32(ui_num);
+ _num = Convert.ToInt64(ui_num);
+ _ul_num = Convert.ToUInt64(ui_num);
+ _num = Convert.ToSingle(ui_num);
+ _num = Convert.ToDouble(ui_num);
+ _num = Convert.ToDecimal(ui_num);
+ }
+
+ public static uint operator %(numHolder a, uint b)
+ {
+ return a._ui_num % b;
+ }
+
+ public numHolder(long l_num)
+ {
+ _num = Convert.ToInt32(l_num);
+ _ui_num = Convert.ToUInt32(l_num);
+ this._num = Convert.ToInt64(l_num);
+ _ul_num = Convert.ToUInt64(l_num);
+ _num = Convert.ToSingle(l_num);
+ _num = Convert.ToDouble(l_num);
+ _num = Convert.ToDecimal(l_num);
+ }
+
+ public static long operator %(numHolder a, long b)
+ {
+ return a._num % b;
+ }
+
+ public numHolder(ulong ul_num)
+ {
+ _num = Convert.ToInt32(ul_num);
+ _ui_num = Convert.ToUInt32(ul_num);
+ _num = Convert.ToInt64(ul_num);
+ _ul_num = Convert.ToUInt64(ul_num);
+ _num = Convert.ToSingle(ul_num);
+ _num = Convert.ToDouble(ul_num);
+ _num = Convert.ToDecimal(ul_num);
+ }
+
+ public static long operator %(numHolder a, ulong b)
+ {
+ return (long)(a._ul_num % b);
+ }
+
+ public numHolder(float f_num)
+ {
+ _num = Convert.ToInt32(f_num);
+ _ui_num = Convert.ToUInt32(f_num);
+ _num = Convert.ToInt64(f_num);
+ _ul_num = Convert.ToUInt64(f_num);
+ this._num = Convert.ToSingle(f_num);
+ _num = Convert.ToDouble(f_num);
+ _num = Convert.ToDecimal(f_num);
+ }
+
+ public static float operator %(numHolder a, float b)
+ {
+ return a._num % b;
+ }
+
+ public numHolder(double d_num)
+ {
+ _num = Convert.ToInt32(d_num);
+ _ui_num = Convert.ToUInt32(d_num);
+ _num = Convert.ToInt64(d_num);
+ _ul_num = Convert.ToUInt64(d_num);
+ _num = Convert.ToSingle(d_num);
+ this._num = Convert.ToDouble(d_num);
+ _num = Convert.ToDecimal(d_num);
+ }
+
+ public static double operator %(numHolder a, double b)
+ {
+ return a._num % b;
+ }
+
+ public numHolder(decimal m_num)
+ {
+ _num = Convert.ToInt32(m_num);
+ _ui_num = Convert.ToUInt32(m_num);
+ _num = Convert.ToInt64(m_num);
+ _ul_num = Convert.ToUInt64(m_num);
+ _num = Convert.ToSingle(m_num);
+ _num = Convert.ToDouble(m_num);
+ this._num = Convert.ToDecimal(m_num);
+ }
+
+ public static int operator %(numHolder a, decimal b)
+ {
+ return (int)(a._num % b);
+ }
+
+ public static int operator %(numHolder a, numHolder b)
+ {
+ return a._num % b._num;
+ }
+ }
+
+ private static int s_s_op1 = 9;
+ private static uint s_ui_s_op1 = 9;
+ private static long s_s_op1 = 9;
+ private static ulong s_ul_s_op1 = 9;
+ private static float s_s_op1 = 9;
+ private static double s_s_op1 = 9;
+ private static decimal s_s_op1 = 9;
+
+ private static int s_s_op2 = 5;
+ private static uint s_ui_s_op2 = 5;
+ private static long s_s_op2 = 5;
+ private static ulong s_ul_s_op2 = 5;
+ private static float s_s_op2 = 5;
+ private static double s_s_op2 = 5;
+ private static decimal s_s_op2 = 5;
+ private static numHolder s_nHldr_s_op2 = new numHolder(5);
+
+ public static int i_f(String s)
+ {
+ if (s == "op1")
+ return 9;
+ else
+ return 5;
+ }
+ public static uint ui_f(String s)
+ {
+ if (s == "op1")
+ return 9;
+ else
+ return 5;
+ }
+ public static long l_f(String s)
+ {
+ if (s == "op1")
+ return 9;
+ else
+ return 5;
+ }
+ public static ulong ul_f(String s)
+ {
+ if (s == "op1")
+ return 9;
+ else
+ return 5;
+ }
+ public static float f_f(String s)
+ {
+ if (s == "op1")
+ return 9;
+ else
+ return 5;
+ }
+ public static double d_f(String s)
+ {
+ if (s == "op1")
+ return 9;
+ else
+ return 5;
+ }
+ public static decimal m_f(String s)
+ {
+ if (s == "op1")
+ return 9;
+ else
+ return 5;
+ }
+ public static numHolder nHldr_f(String s)
+ {
+ if (s == "op1")
+ return new numHolder(9);
+ else
+ return new numHolder(5);
+ }
+ private class CL
+ {
+ public int i_cl_op1 = 9;
+ public uint ui_cl_op1 = 9;
+ public long l_cl_op1 = 9;
+ public ulong ul_cl_op1 = 9;
+ public float f_cl_op1 = 9;
+ public double d_cl_op1 = 9;
+ public decimal m_cl_op1 = 9;
+
+ public int i_cl_op2 = 5;
+ public uint ui_cl_op2 = 5;
+ public long l_cl_op2 = 5;
+ public ulong ul_cl_op2 = 5;
+ public float f_cl_op2 = 5;
+ public double d_cl_op2 = 5;
+ public decimal m_cl_op2 = 5;
+ public numHolder nHldr_cl_op2 = new numHolder(5);
+ }
+
+ private struct VT
+ {
+ public int i_vt_op1;
+ public uint ui_vt_op1;
+ public long l_vt_op1;
+ public ulong ul_vt_op1;
+ public float f_vt_op1;
+ public double d_vt_op1;
+ public decimal m_vt_op1;
+
+ public int i_vt_op2;
+ public uint ui_vt_op2;
+ public long l_vt_op2;
+ public ulong ul_vt_op2;
+ public float f_vt_op2;
+ public double d_vt_op2;
+ public decimal m_vt_op2;
+ public numHolder nHldr_vt_op2;
+ }
+
+ public static int Main()
+ {
+ bool passed = true;
+ //initialize class
+ CL cl1 = new CL();
+ //initialize struct
+ VT vt1;
+ vt1.i_vt_op1 = 9;
+ vt1.ui_vt_op1 = 9;
+ vt1.l_vt_op1 = 9;
+ vt1.ul_vt_op1 = 9;
+ vt1.f_vt_op1 = 9;
+ vt1.d_vt_op1 = 9;
+ vt1.m_vt_op1 = 9;
+ vt1.i_vt_op2 = 5;
+ vt1.ui_vt_op2 = 5;
+ vt1.l_vt_op2 = 5;
+ vt1.ul_vt_op2 = 5;
+ vt1.f_vt_op2 = 5;
+ vt1.d_vt_op2 = 5;
+ vt1.m_vt_op2 = 5;
+ vt1.nHldr_vt_op2 = new numHolder(5);
+
+ int[] i_arr1d_op1 = { 0, 9 };
+ int[,] i_arr2d_op1 = { { 0, 9 }, { 1, 1 } };
+ int[,,] i_arr3d_op1 = { { { 0, 9 }, { 1, 1 } } };
+ uint[] ui_arr1d_op1 = { 0, 9 };
+ uint[,] ui_arr2d_op1 = { { 0, 9 }, { 1, 1 } };
+ uint[,,] ui_arr3d_op1 = { { { 0, 9 }, { 1, 1 } } };
+ long[] l_arr1d_op1 = { 0, 9 };
+ long[,] l_arr2d_op1 = { { 0, 9 }, { 1, 1 } };
+ long[,,] l_arr3d_op1 = { { { 0, 9 }, { 1, 1 } } };
+ ulong[] ul_arr1d_op1 = { 0, 9 };
+ ulong[,] ul_arr2d_op1 = { { 0, 9 }, { 1, 1 } };
+ ulong[,,] ul_arr3d_op1 = { { { 0, 9 }, { 1, 1 } } };
+ float[] f_arr1d_op1 = { 0, 9 };
+ float[,] f_arr2d_op1 = { { 0, 9 }, { 1, 1 } };
+ float[,,] f_arr3d_op1 = { { { 0, 9 }, { 1, 1 } } };
+ double[] d_arr1d_op1 = { 0, 9 };
+ double[,] d_arr2d_op1 = { { 0, 9 }, { 1, 1 } };
+ double[,,] d_arr3d_op1 = { { { 0, 9 }, { 1, 1 } } };
+ decimal[] m_arr1d_op1 = { 0, 9 };
+ decimal[,] m_arr2d_op1 = { { 0, 9 }, { 1, 1 } };
+ decimal[,,] m_arr3d_op1 = { { { 0, 9 }, { 1, 1 } } };
+
+ int[] i_arr1d_op2 = { 5, 0, 1 };
+ int[,] i_arr2d_op2 = { { 0, 5 }, { 1, 1 } };
+ int[,,] i_arr3d_op2 = { { { 0, 5 }, { 1, 1 } } };
+ uint[] ui_arr1d_op2 = { 5, 0, 1 };
+ uint[,] ui_arr2d_op2 = { { 0, 5 }, { 1, 1 } };
+ uint[,,] ui_arr3d_op2 = { { { 0, 5 }, { 1, 1 } } };
+ long[] l_arr1d_op2 = { 5, 0, 1 };
+ long[,] l_arr2d_op2 = { { 0, 5 }, { 1, 1 } };
+ long[,,] l_arr3d_op2 = { { { 0, 5 }, { 1, 1 } } };
+ ulong[] ul_arr1d_op2 = { 5, 0, 1 };
+ ulong[,] ul_arr2d_op2 = { { 0, 5 }, { 1, 1 } };
+ ulong[,,] ul_arr3d_op2 = { { { 0, 5 }, { 1, 1 } } };
+ float[] f_arr1d_op2 = { 5, 0, 1 };
+ float[,] f_arr2d_op2 = { { 0, 5 }, { 1, 1 } };
+ float[,,] f_arr3d_op2 = { { { 0, 5 }, { 1, 1 } } };
+ double[] d_arr1d_op2 = { 5, 0, 1 };
+ double[,] d_arr2d_op2 = { { 0, 5 }, { 1, 1 } };
+ double[,,] d_arr3d_op2 = { { { 0, 5 }, { 1, 1 } } };
+ decimal[] m_arr1d_op2 = { 5, 0, 1 };
+ decimal[,] m_arr2d_op2 = { { 0, 5 }, { 1, 1 } };
+ decimal[,,] m_arr3d_op2 = { { { 0, 5 }, { 1, 1 } } };
+ numHolder[] nHldr_arr1d_op2 = { new numHolder(5), new numHolder(0), new numHolder(1) };
+ numHolder[,] nHldr_arr2d_op2 = { { new numHolder(0), new numHolder(5) }, { new numHolder(1), new numHolder(1) } };
+ numHolder[,,] nHldr_arr3d_op2 = { { { new numHolder(0), new numHolder(5) }, { new numHolder(1), new numHolder(1) } } };
+
+ int[,] index = { { 0, 0 }, { 1, 1 } };
+
+ {
+ int i_l_op1 = 9;
+ int i_l_op2 = 5;
+ uint ui_l_op2 = 5;
+ long l_l_op2 = 5;
+ ulong ul_l_op2 = 5;
+ float f_l_op2 = 5;
+ double d_l_op2 = 5;
+ decimal m_l_op2 = 5;
+ numHolder nHldr_l_op2 = new numHolder(5);
+ if ((i_l_op1 % i_l_op2 != i_l_op1 % ui_l_op2) || (i_l_op1 % ui_l_op2 != i_l_op1 % l_l_op2) || (i_l_op1 % l_l_op2 != i_l_op1 % (int)ul_l_op2) || (i_l_op1 % (int)ul_l_op2 != i_l_op1 % f_l_op2) || (i_l_op1 % f_l_op2 != i_l_op1 % d_l_op2) || ((decimal)(i_l_op1 % d_l_op2) != i_l_op1 % m_l_op2) || (i_l_op1 % m_l_op2 != i_l_op1 % i_l_op2) || (i_l_op1 % i_l_op2 != 4))
+ {
+ Console.WriteLine("testcase 1 failed");
+ passed = false;
+ }
+ if ((i_l_op1 % s_s_op2 != i_l_op1 % s_ui_s_op2) || (i_l_op1 % s_ui_s_op2 != i_l_op1 % s_s_op2) || (i_l_op1 % s_s_op2 != i_l_op1 % (int)s_ul_s_op2) || (i_l_op1 % (int)s_ul_s_op2 != i_l_op1 % s_s_op2) || (i_l_op1 % s_s_op2 != i_l_op1 % s_s_op2) || ((decimal)(i_l_op1 % s_s_op2) != i_l_op1 % s_s_op2) || (i_l_op1 % s_s_op2 != i_l_op1 % s_s_op2) || (i_l_op1 % s_s_op2 != 4))
+ {
+ Console.WriteLine("testcase 2 failed");
+ passed = false;
+ }
+ if ((s_s_op1 % i_l_op2 != s_s_op1 % ui_l_op2) || (s_s_op1 % ui_l_op2 != s_s_op1 % l_l_op2) || (s_s_op1 % l_l_op2 != s_s_op1 % (int)ul_l_op2) || (s_s_op1 % (int)ul_l_op2 != s_s_op1 % f_l_op2) || (s_s_op1 % f_l_op2 != s_s_op1 % d_l_op2) || ((decimal)(s_s_op1 % d_l_op2) != s_s_op1 % m_l_op2) || (s_s_op1 % m_l_op2 != s_s_op1 % i_l_op2) || (s_s_op1 % i_l_op2 != 4))
+ {
+ Console.WriteLine("testcase 3 failed");
+ passed = false;
+ }
+ if ((s_s_op1 % s_s_op2 != s_s_op1 % s_ui_s_op2) || (s_s_op1 % s_ui_s_op2 != s_s_op1 % s_s_op2) || (s_s_op1 % s_s_op2 != s_s_op1 % (int)s_ul_s_op2) || (s_s_op1 % (int)s_ul_s_op2 != s_s_op1 % s_s_op2) || (s_s_op1 % s_s_op2 != s_s_op1 % s_s_op2) || ((decimal)(s_s_op1 % s_s_op2) != s_s_op1 % s_s_op2) || (s_s_op1 % s_s_op2 != s_s_op1 % s_s_op2) || (s_s_op1 % s_s_op2 != 4))
+ {
+ Console.WriteLine("testcase 4 failed");
+ passed = false;
+ }
+ }
+
+ {
+ uint ui_l_op1 = 9;
+ int i_l_op2 = 5;
+ uint ui_l_op2 = 5;
+ long l_l_op2 = 5;
+ ulong ul_l_op2 = 5;
+ float f_l_op2 = 5;
+ double d_l_op2 = 5;
+ decimal m_l_op2 = 5;
+ numHolder nHldr_l_op2 = new numHolder(5);
+ if ((ui_l_op1 % i_l_op2 != ui_l_op1 % ui_l_op2) || (ui_l_op1 % ui_l_op2 != ui_l_op1 % l_l_op2) || ((ulong)(ui_l_op1 % l_l_op2) != ui_l_op1 % ul_l_op2) || (ui_l_op1 % ul_l_op2 != ui_l_op1 % f_l_op2) || (ui_l_op1 % f_l_op2 != ui_l_op1 % d_l_op2) || ((decimal)(ui_l_op1 % d_l_op2) != ui_l_op1 % m_l_op2) || (ui_l_op1 % m_l_op2 != ui_l_op1 % i_l_op2) || (ui_l_op1 % i_l_op2 != 4))
+ {
+ Console.WriteLine("testcase 5 failed");
+ passed = false;
+ }
+ if ((ui_l_op1 % s_s_op2 != ui_l_op1 % s_ui_s_op2) || (ui_l_op1 % s_ui_s_op2 != ui_l_op1 % s_s_op2) || ((ulong)(ui_l_op1 % s_s_op2) != ui_l_op1 % s_ul_s_op2) || (ui_l_op1 % s_ul_s_op2 != ui_l_op1 % s_s_op2) || (ui_l_op1 % s_s_op2 != ui_l_op1 % s_s_op2) || ((decimal)(ui_l_op1 % s_s_op2) != ui_l_op1 % s_s_op2) || (ui_l_op1 % s_s_op2 != ui_l_op1 % s_s_op2) || (ui_l_op1 % s_s_op2 != 4))
+ {
+ Console.WriteLine("testcase 6 failed");
+ passed = false;
+ }
+ if ((s_ui_s_op1 % i_l_op2 != s_ui_s_op1 % ui_l_op2) || (s_ui_s_op1 % ui_l_op2 != s_ui_s_op1 % l_l_op2) || ((ulong)(s_ui_s_op1 % l_l_op2) != s_ui_s_op1 % ul_l_op2) || (s_ui_s_op1 % ul_l_op2 != s_ui_s_op1 % f_l_op2) || (s_ui_s_op1 % f_l_op2 != s_ui_s_op1 % d_l_op2) || ((decimal)(s_ui_s_op1 % d_l_op2) != s_ui_s_op1 % m_l_op2) || (s_ui_s_op1 % m_l_op2 != s_ui_s_op1 % i_l_op2) || (s_ui_s_op1 % i_l_op2 != 4))
+ {
+ Console.WriteLine("testcase 7 failed");
+ passed = false;
+ }
+ if ((s_ui_s_op1 % s_s_op2 != s_ui_s_op1 % s_ui_s_op2) || (s_ui_s_op1 % s_ui_s_op2 != s_ui_s_op1 % s_s_op2) || ((ulong)(s_ui_s_op1 % s_s_op2) != s_ui_s_op1 % s_ul_s_op2) || (s_ui_s_op1 % s_ul_s_op2 != s_ui_s_op1 % s_s_op2) || (s_ui_s_op1 % s_s_op2 != s_ui_s_op1 % s_s_op2) || ((decimal)(s_ui_s_op1 % s_s_op2) != s_ui_s_op1 % s_s_op2) || (s_ui_s_op1 % s_s_op2 != s_ui_s_op1 % s_s_op2) || (s_ui_s_op1 % s_s_op2 != 4))
+ {
+ Console.WriteLine("testcase 8 failed");
+ passed = false;
+ }
+ }
+
+ {
+ long l_l_op1 = 9;
+ int i_l_op2 = 5;
+ uint ui_l_op2 = 5;
+ long l_l_op2 = 5;
+ ulong ul_l_op2 = 5;
+ float f_l_op2 = 5;
+ double d_l_op2 = 5;
+ decimal m_l_op2 = 5;
+ numHolder nHldr_l_op2 = new numHolder(5);
+ if ((l_l_op1 % i_l_op2 != l_l_op1 % ui_l_op2) || (l_l_op1 % ui_l_op2 != l_l_op1 % l_l_op2) || (l_l_op1 % l_l_op2 != l_l_op1 % (long)ul_l_op2) || (l_l_op1 % (long)ul_l_op2 != l_l_op1 % f_l_op2) || (l_l_op1 % f_l_op2 != l_l_op1 % d_l_op2) || ((decimal)(l_l_op1 % d_l_op2) != l_l_op1 % m_l_op2) || (l_l_op1 % m_l_op2 != l_l_op1 % i_l_op2) || (l_l_op1 % i_l_op2 != 4))
+ {
+ Console.WriteLine("testcase 9 failed");
+ passed = false;
+ }
+ if ((l_l_op1 % s_s_op2 != l_l_op1 % s_ui_s_op2) || (l_l_op1 % s_ui_s_op2 != l_l_op1 % s_s_op2) || (l_l_op1 % s_s_op2 != l_l_op1 % (long)s_ul_s_op2) || (l_l_op1 % (long)s_ul_s_op2 != l_l_op1 % s_s_op2) || (l_l_op1 % s_s_op2 != l_l_op1 % s_s_op2) || ((decimal)(l_l_op1 % s_s_op2) != l_l_op1 % s_s_op2) || (l_l_op1 % s_s_op2 != l_l_op1 % s_s_op2) || (l_l_op1 % s_s_op2 != 4))
+ {
+ Console.WriteLine("testcase 10 failed");
+ passed = false;
+ }
+ if ((s_s_op1 % i_l_op2 != s_s_op1 % ui_l_op2) || (s_s_op1 % ui_l_op2 != s_s_op1 % l_l_op2) || (s_s_op1 % l_l_op2 != s_s_op1 % (long)ul_l_op2) || (s_s_op1 % (long)ul_l_op2 != s_s_op1 % f_l_op2) || (s_s_op1 % f_l_op2 != s_s_op1 % d_l_op2) || ((decimal)(s_s_op1 % d_l_op2) != s_s_op1 % m_l_op2) || (s_s_op1 % m_l_op2 != s_s_op1 % i_l_op2) || (s_s_op1 % i_l_op2 != 4))
+ {
+ Console.WriteLine("testcase 11 failed");
+ passed = false;
+ }
+ if ((s_s_op1 % s_s_op2 != s_s_op1 % s_ui_s_op2) || (s_s_op1 % s_ui_s_op2 != s_s_op1 % s_s_op2) || (s_s_op1 % s_s_op2 != s_s_op1 % (long)s_ul_s_op2) || (s_s_op1 % (long)s_ul_s_op2 != s_s_op1 % s_s_op2) || (s_s_op1 % s_s_op2 != s_s_op1 % s_s_op2) || ((decimal)(s_s_op1 % s_s_op2) != s_s_op1 % s_s_op2) || (s_s_op1 % s_s_op2 != s_s_op1 % s_s_op2) || (s_s_op1 % s_s_op2 != 4))
+ {
+ Console.WriteLine("testcase 12 failed");
+ passed = false;
+ }
+ }
+
+ {
+ ulong ul_l_op1 = 9;
+ int i_l_op2 = 5;
+ uint ui_l_op2 = 5;
+ long l_l_op2 = 5;
+ ulong ul_l_op2 = 5;
+ float f_l_op2 = 5;
+ double d_l_op2 = 5;
+ decimal m_l_op2 = 5;
+ numHolder nHldr_l_op2 = new numHolder(5);
+ if ((ul_l_op1 % (ulong)i_l_op2 != ul_l_op1 % ui_l_op2) || (ul_l_op1 % ui_l_op2 != ul_l_op1 % (ulong)l_l_op2) || (ul_l_op1 % (ulong)l_l_op2 != ul_l_op1 % ul_l_op2) || (ul_l_op1 % ul_l_op2 != ul_l_op1 % f_l_op2) || (ul_l_op1 % f_l_op2 != ul_l_op1 % d_l_op2) || ((decimal)(ul_l_op1 % d_l_op2) != ul_l_op1 % m_l_op2) || (ul_l_op1 % m_l_op2 != ul_l_op1 % (ulong)i_l_op2) || (ul_l_op1 % (ulong)i_l_op2 != 4))
+ {
+ Console.WriteLine("testcase 13 failed");
+ passed = false;
+ }
+ if ((ul_l_op1 % (ulong)s_s_op2 != ul_l_op1 % s_ui_s_op2) || (ul_l_op1 % s_ui_s_op2 != ul_l_op1 % (ulong)s_s_op2) || (ul_l_op1 % (ulong)s_s_op2 != ul_l_op1 % s_ul_s_op2) || (ul_l_op1 % s_ul_s_op2 != ul_l_op1 % s_s_op2) || (ul_l_op1 % s_s_op2 != ul_l_op1 % s_s_op2) || ((decimal)(ul_l_op1 % s_s_op2) != ul_l_op1 % s_s_op2) || (ul_l_op1 % s_s_op2 != ul_l_op1 % (ulong)s_s_op2) || (ul_l_op1 % (ulong)s_s_op2 != 4))
+ {
+ Console.WriteLine("testcase 14 failed");
+ passed = false;
+ }
+ if ((s_ul_s_op1 % (ulong)i_l_op2 != s_ul_s_op1 % ui_l_op2) || (s_ul_s_op1 % ui_l_op2 != s_ul_s_op1 % (ulong)l_l_op2) || (s_ul_s_op1 % (ulong)l_l_op2 != s_ul_s_op1 % ul_l_op2) || (s_ul_s_op1 % ul_l_op2 != s_ul_s_op1 % f_l_op2) || (s_ul_s_op1 % f_l_op2 != s_ul_s_op1 % d_l_op2) || ((decimal)(s_ul_s_op1 % d_l_op2) != s_ul_s_op1 % m_l_op2) || (s_ul_s_op1 % m_l_op2 != s_ul_s_op1 % (ulong)i_l_op2) || (s_ul_s_op1 % (ulong)i_l_op2 != 4))
+ {
+ Console.WriteLine("testcase 15 failed");
+ passed = false;
+ }
+ if ((s_ul_s_op1 % (ulong)s_s_op2 != s_ul_s_op1 % s_ui_s_op2) || (s_ul_s_op1 % s_ui_s_op2 != s_ul_s_op1 % (ulong)s_s_op2) || (s_ul_s_op1 % (ulong)s_s_op2 != s_ul_s_op1 % s_ul_s_op2) || (s_ul_s_op1 % s_ul_s_op2 != s_ul_s_op1 % s_s_op2) || (s_ul_s_op1 % s_s_op2 != s_ul_s_op1 % s_s_op2) || ((decimal)(s_ul_s_op1 % s_s_op2) != s_ul_s_op1 % s_s_op2) || (s_ul_s_op1 % s_s_op2 != s_ul_s_op1 % (ulong)s_s_op2) || (s_ul_s_op1 % (ulong)s_s_op2 != 4))
+ {
+ Console.WriteLine("testcase 16 failed");
+ passed = false;
+ }
+ }
+
+ {
+ float f_l_op1 = 9;
+ int i_l_op2 = 5;
+ uint ui_l_op2 = 5;
+ long l_l_op2 = 5;
+ ulong ul_l_op2 = 5;
+ float f_l_op2 = 5;
+ double d_l_op2 = 5;
+ decimal m_l_op2 = 5;
+ numHolder nHldr_l_op2 = new numHolder(5);
+ if ((f_l_op1 % i_l_op2 != f_l_op1 % ui_l_op2) || (f_l_op1 % ui_l_op2 != f_l_op1 % l_l_op2) || (f_l_op1 % l_l_op2 != f_l_op1 % ul_l_op2) || (f_l_op1 % ul_l_op2 != f_l_op1 % f_l_op2) || (f_l_op1 % f_l_op2 != f_l_op1 % d_l_op2) || (f_l_op1 % d_l_op2 != f_l_op1 % (float)m_l_op2) || (f_l_op1 % (float)m_l_op2 != f_l_op1 % i_l_op2) || (f_l_op1 % i_l_op2 != 4))
+ {
+ Console.WriteLine("testcase 17 failed");
+ passed = false;
+ }
+ if ((f_l_op1 % s_s_op2 != f_l_op1 % s_ui_s_op2) || (f_l_op1 % s_ui_s_op2 != f_l_op1 % s_s_op2) || (f_l_op1 % s_s_op2 != f_l_op1 % s_ul_s_op2) || (f_l_op1 % s_ul_s_op2 != f_l_op1 % s_s_op2) || (f_l_op1 % s_s_op2 != f_l_op1 % s_s_op2) || (f_l_op1 % s_s_op2 != f_l_op1 % (float)s_s_op2) || (f_l_op1 % (float)s_s_op2 != f_l_op1 % s_s_op2) || (f_l_op1 % s_s_op2 != 4))
+ {
+ Console.WriteLine("testcase 18 failed");
+ passed = false;
+ }
+ if ((s_s_op1 % i_l_op2 != s_s_op1 % ui_l_op2) || (s_s_op1 % ui_l_op2 != s_s_op1 % l_l_op2) || (s_s_op1 % l_l_op2 != s_s_op1 % ul_l_op2) || (s_s_op1 % ul_l_op2 != s_s_op1 % f_l_op2) || (s_s_op1 % f_l_op2 != s_s_op1 % d_l_op2) || (s_s_op1 % d_l_op2 != s_s_op1 % (float)m_l_op2) || (s_s_op1 % (float)m_l_op2 != s_s_op1 % i_l_op2) || (s_s_op1 % i_l_op2 != 4))
+ {
+ Console.WriteLine("testcase 19 failed");
+ passed = false;
+ }
+ if ((s_s_op1 % s_s_op2 != s_s_op1 % s_ui_s_op2) || (s_s_op1 % s_ui_s_op2 != s_s_op1 % s_s_op2) || (s_s_op1 % s_s_op2 != s_s_op1 % s_ul_s_op2) || (s_s_op1 % s_ul_s_op2 != s_s_op1 % s_s_op2) || (s_s_op1 % s_s_op2 != s_s_op1 % s_s_op2) || (s_s_op1 % s_s_op2 != s_s_op1 % (float)s_s_op2) || (s_s_op1 % (float)s_s_op2 != s_s_op1 % s_s_op2) || (s_s_op1 % s_s_op2 != 4))
+ {
+ Console.WriteLine("testcase 20 failed");
+ passed = false;
+ }
+ }
+
+ {
+ double d_l_op1 = 9;
+ int i_l_op2 = 5;
+ uint ui_l_op2 = 5;
+ long l_l_op2 = 5;
+ ulong ul_l_op2 = 5;
+ float f_l_op2 = 5;
+ double d_l_op2 = 5;
+ decimal m_l_op2 = 5;
+ numHolder nHldr_l_op2 = new numHolder(5);
+ if ((d_l_op1 % i_l_op2 != d_l_op1 % ui_l_op2) || (d_l_op1 % ui_l_op2 != d_l_op1 % l_l_op2) || (d_l_op1 % l_l_op2 != d_l_op1 % ul_l_op2) || (d_l_op1 % ul_l_op2 != d_l_op1 % f_l_op2) || (d_l_op1 % f_l_op2 != d_l_op1 % d_l_op2) || (d_l_op1 % d_l_op2 != d_l_op1 % (double)m_l_op2) || (d_l_op1 % (double)m_l_op2 != d_l_op1 % i_l_op2) || (d_l_op1 % i_l_op2 != 4))
+ {
+ Console.WriteLine("testcase 21 failed");
+ passed = false;
+ }
+ if ((d_l_op1 % s_s_op2 != d_l_op1 % s_ui_s_op2) || (d_l_op1 % s_ui_s_op2 != d_l_op1 % s_s_op2) || (d_l_op1 % s_s_op2 != d_l_op1 % s_ul_s_op2) || (d_l_op1 % s_ul_s_op2 != d_l_op1 % s_s_op2) || (d_l_op1 % s_s_op2 != d_l_op1 % s_s_op2) || (d_l_op1 % s_s_op2 != d_l_op1 % (double)s_s_op2) || (d_l_op1 % (double)s_s_op2 != d_l_op1 % s_s_op2) || (d_l_op1 % s_s_op2 != 4))
+ {
+ Console.WriteLine("testcase 22 failed");
+ passed = false;
+ }
+ if ((s_s_op1 % i_l_op2 != s_s_op1 % ui_l_op2) || (s_s_op1 % ui_l_op2 != s_s_op1 % l_l_op2) || (s_s_op1 % l_l_op2 != s_s_op1 % ul_l_op2) || (s_s_op1 % ul_l_op2 != s_s_op1 % f_l_op2) || (s_s_op1 % f_l_op2 != s_s_op1 % d_l_op2) || (s_s_op1 % d_l_op2 != s_s_op1 % (double)m_l_op2) || (s_s_op1 % (double)m_l_op2 != s_s_op1 % i_l_op2) || (s_s_op1 % i_l_op2 != 4))
+ {
+ Console.WriteLine("testcase 23 failed");
+ passed = false;
+ }
+ if ((s_s_op1 % s_s_op2 != s_s_op1 % s_ui_s_op2) || (s_s_op1 % s_ui_s_op2 != s_s_op1 % s_s_op2) || (s_s_op1 % s_s_op2 != s_s_op1 % s_ul_s_op2) || (s_s_op1 % s_ul_s_op2 != s_s_op1 % s_s_op2) || (s_s_op1 % s_s_op2 != s_s_op1 % s_s_op2) || (s_s_op1 % s_s_op2 != s_s_op1 % (double)s_s_op2) || (s_s_op1 % (double)s_s_op2 != s_s_op1 % s_s_op2) || (s_s_op1 % s_s_op2 != 4))
+ {
+ Console.WriteLine("testcase 24 failed");
+ passed = false;
+ }
+ }
+
+ {
+ decimal m_l_op1 = 9;
+ int i_l_op2 = 5;
+ uint ui_l_op2 = 5;
+ long l_l_op2 = 5;
+ ulong ul_l_op2 = 5;
+ float f_l_op2 = 5;
+ double d_l_op2 = 5;
+ decimal m_l_op2 = 5;
+ numHolder nHldr_l_op2 = new numHolder(5);
+ if ((m_l_op1 % i_l_op2 != m_l_op1 % ui_l_op2) || (m_l_op1 % ui_l_op2 != m_l_op1 % l_l_op2) || (m_l_op1 % l_l_op2 != m_l_op1 % ul_l_op2) || (m_l_op1 % ul_l_op2 != m_l_op1 % (decimal)f_l_op2) || (m_l_op1 % (decimal)f_l_op2 != m_l_op1 % (decimal)d_l_op2) || (m_l_op1 % (decimal)d_l_op2 != m_l_op1 % m_l_op2) || (m_l_op1 % m_l_op2 != m_l_op1 % i_l_op2) || (m_l_op1 % i_l_op2 != 4))
+ {
+ Console.WriteLine("testcase 25 failed");
+ passed = false;
+ }
+ if ((m_l_op1 % s_s_op2 != m_l_op1 % s_ui_s_op2) || (m_l_op1 % s_ui_s_op2 != m_l_op1 % s_s_op2) || (m_l_op1 % s_s_op2 != m_l_op1 % s_ul_s_op2) || (m_l_op1 % s_ul_s_op2 != m_l_op1 % (decimal)s_s_op2) || (m_l_op1 % (decimal)s_s_op2 != m_l_op1 % (decimal)s_s_op2) || (m_l_op1 % (decimal)s_s_op2 != m_l_op1 % s_s_op2) || (m_l_op1 % s_s_op2 != m_l_op1 % s_s_op2) || (m_l_op1 % s_s_op2 != 4))
+ {
+ Console.WriteLine("testcase 26 failed");
+ passed = false;
+ }
+ if ((s_s_op1 % i_l_op2 != s_s_op1 % ui_l_op2) || (s_s_op1 % ui_l_op2 != s_s_op1 % l_l_op2) || (s_s_op1 % l_l_op2 != s_s_op1 % ul_l_op2) || (s_s_op1 % ul_l_op2 != s_s_op1 % (decimal)f_l_op2) || (s_s_op1 % (decimal)f_l_op2 != s_s_op1 % (decimal)d_l_op2) || (s_s_op1 % (decimal)d_l_op2 != s_s_op1 % m_l_op2) || (s_s_op1 % m_l_op2 != s_s_op1 % i_l_op2) || (s_s_op1 % i_l_op2 != 4))
+ {
+ Console.WriteLine("testcase 27 failed");
+ passed = false;
+ }
+ if ((s_s_op1 % s_s_op2 != s_s_op1 % s_ui_s_op2) || (s_s_op1 % s_ui_s_op2 != s_s_op1 % s_s_op2) || (s_s_op1 % s_s_op2 != s_s_op1 % s_ul_s_op2) || (s_s_op1 % s_ul_s_op2 != s_s_op1 % (decimal)s_s_op2) || (s_s_op1 % (decimal)s_s_op2 != s_s_op1 % (decimal)s_s_op2) || (s_s_op1 % (decimal)s_s_op2 != s_s_op1 % s_s_op2) || (s_s_op1 % s_s_op2 != s_s_op1 % s_s_op2) || (s_s_op1 % s_s_op2 != 4))
+ {
+ Console.WriteLine("testcase 28 failed");
+ passed = false;
+ }
+ }
+
+ if (!passed)
+ {
+ Console.WriteLine("FAILED");
+ return 1;
+ }
+ else
+ {
+ Console.WriteLine("PASSED");
+ return 100;
+ }
+ }
+}
diff --git a/tests/src/JIT/Directed/coverage/oldtests/lclfldsub.cs b/tests/src/JIT/Directed/coverage/oldtests/lclfldsub.cs
new file mode 100644
index 0000000000..21e524d6e3
--- /dev/null
+++ b/tests/src/JIT/Directed/coverage/oldtests/lclfldsub.cs
@@ -0,0 +1,559 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+//
+
+//Testing simple math on local vars and fields - sub
+
+#pragma warning disable 0414
+using System;
+internal class lclfldsub
+{
+ //user-defined class that overloads operator -
+ public class numHolder
+ {
+ private int _num;
+ private uint _ui_num;
+ private long _num;
+ private ulong _ul_num;
+ private float _num;
+ private double _num;
+ private decimal _num;
+ public numHolder(int i_num)
+ {
+ _num = Convert.ToInt32(i_num);
+ _ui_num = Convert.ToUInt32(i_num);
+ _num = Convert.ToInt64(i_num);
+ _ul_num = Convert.ToUInt64(i_num);
+ _num = Convert.ToSingle(i_num);
+ _num = Convert.ToDouble(i_num);
+ _num = Convert.ToDecimal(i_num);
+ }
+
+ public static int operator -(numHolder a, int b)
+ {
+ return a._num - b;
+ }
+
+ public numHolder(uint ui_num)
+ {
+ _num = Convert.ToInt32(ui_num);
+ _ui_num = Convert.ToUInt32(ui_num);
+ _num = Convert.ToInt64(ui_num);
+ _ul_num = Convert.ToUInt64(ui_num);
+ _num = Convert.ToSingle(ui_num);
+ _num = Convert.ToDouble(ui_num);
+ _num = Convert.ToDecimal(ui_num);
+ }
+
+ public static uint operator -(numHolder a, uint b)
+ {
+ return a._ui_num - b;
+ }
+
+ public numHolder(long l_num)
+ {
+ _num = Convert.ToInt32(l_num);
+ _ui_num = Convert.ToUInt32(l_num);
+ this._num = Convert.ToInt64(l_num);
+ _ul_num = Convert.ToUInt64(l_num);
+ _num = Convert.ToSingle(l_num);
+ _num = Convert.ToDouble(l_num);
+ _num = Convert.ToDecimal(l_num);
+ }
+
+ public static long operator -(numHolder a, long b)
+ {
+ return a._num - b;
+ }
+
+ public numHolder(ulong ul_num)
+ {
+ _num = Convert.ToInt32(ul_num);
+ _ui_num = Convert.ToUInt32(ul_num);
+ _num = Convert.ToInt64(ul_num);
+ _ul_num = Convert.ToUInt64(ul_num);
+ _num = Convert.ToSingle(ul_num);
+ _num = Convert.ToDouble(ul_num);
+ _num = Convert.ToDecimal(ul_num);
+ }
+
+ public static long operator -(numHolder a, ulong b)
+ {
+ return (long)(a._ul_num - b);
+ }
+
+ public numHolder(float f_num)
+ {
+ _num = Convert.ToInt32(f_num);
+ _ui_num = Convert.ToUInt32(f_num);
+ _num = Convert.ToInt64(f_num);
+ _ul_num = Convert.ToUInt64(f_num);
+ this._num = Convert.ToSingle(f_num);
+ _num = Convert.ToDouble(f_num);
+ _num = Convert.ToDecimal(f_num);
+ }
+
+ public static float operator -(numHolder a, float b)
+ {
+ return a._num - b;
+ }
+
+ public numHolder(double d_num)
+ {
+ _num = Convert.ToInt32(d_num);
+ _ui_num = Convert.ToUInt32(d_num);
+ _num = Convert.ToInt64(d_num);
+ _ul_num = Convert.ToUInt64(d_num);
+ _num = Convert.ToSingle(d_num);
+ this._num = Convert.ToDouble(d_num);
+ _num = Convert.ToDecimal(d_num);
+ }
+
+ public static double operator -(numHolder a, double b)
+ {
+ return a._num - b;
+ }
+
+ public numHolder(decimal m_num)
+ {
+ _num = Convert.ToInt32(m_num);
+ _ui_num = Convert.ToUInt32(m_num);
+ _num = Convert.ToInt64(m_num);
+ _ul_num = Convert.ToUInt64(m_num);
+ _num = Convert.ToSingle(m_num);
+ _num = Convert.ToDouble(m_num);
+ this._num = Convert.ToDecimal(m_num);
+ }
+
+ public static int operator -(numHolder a, decimal b)
+ {
+ return (int)(a._num - b);
+ }
+
+ public static int operator -(numHolder a, numHolder b)
+ {
+ return a._num - b._num;
+ }
+ }
+
+ private static int s_s_op1 = 16;
+ private static uint s_ui_s_op1 = 16;
+ private static long s_s_op1 = 16;
+ private static ulong s_ul_s_op1 = 16;
+ private static float s_s_op1 = 16;
+ private static double s_s_op1 = 16;
+ private static decimal s_s_op1 = 16;
+
+ private static int s_s_op2 = 15;
+ private static uint s_ui_s_op2 = 15;
+ private static long s_s_op2 = 15;
+ private static ulong s_ul_s_op2 = 15;
+ private static float s_s_op2 = 15;
+ private static double s_s_op2 = 15;
+ private static decimal s_s_op2 = 15;
+ private static numHolder s_nHldr_s_op2 = new numHolder(15);
+
+ public static int i_f(String s)
+ {
+ if (s == "op1")
+ return 16;
+ else
+ return 15;
+ }
+ public static uint ui_f(String s)
+ {
+ if (s == "op1")
+ return 16;
+ else
+ return 15;
+ }
+ public static long l_f(String s)
+ {
+ if (s == "op1")
+ return 16;
+ else
+ return 15;
+ }
+ public static ulong ul_f(String s)
+ {
+ if (s == "op1")
+ return 16;
+ else
+ return 15;
+ }
+ public static float f_f(String s)
+ {
+ if (s == "op1")
+ return 16;
+ else
+ return 15;
+ }
+ public static double d_f(String s)
+ {
+ if (s == "op1")
+ return 16;
+ else
+ return 15;
+ }
+ public static decimal m_f(String s)
+ {
+ if (s == "op1")
+ return 16;
+ else
+ return 15;
+ }
+ public static numHolder nHldr_f(String s)
+ {
+ if (s == "op1")
+ return new numHolder(16);
+ else
+ return new numHolder(15);
+ }
+ private class CL
+ {
+ public int i_cl_op1 = 16;
+ public uint ui_cl_op1 = 16;
+ public long l_cl_op1 = 16;
+ public ulong ul_cl_op1 = 16;
+ public float f_cl_op1 = 16;
+ public double d_cl_op1 = 16;
+ public decimal m_cl_op1 = 16;
+
+ public int i_cl_op2 = 15;
+ public uint ui_cl_op2 = 15;
+ public long l_cl_op2 = 15;
+ public ulong ul_cl_op2 = 15;
+ public float f_cl_op2 = 15;
+ public double d_cl_op2 = 15;
+ public decimal m_cl_op2 = 15;
+ public numHolder nHldr_cl_op2 = new numHolder(15);
+ }
+
+ private struct VT
+ {
+ public int i_vt_op1;
+ public uint ui_vt_op1;
+ public long l_vt_op1;
+ public ulong ul_vt_op1;
+ public float f_vt_op1;
+ public double d_vt_op1;
+ public decimal m_vt_op1;
+
+ public int i_vt_op2;
+ public uint ui_vt_op2;
+ public long l_vt_op2;
+ public ulong ul_vt_op2;
+ public float f_vt_op2;
+ public double d_vt_op2;
+ public decimal m_vt_op2;
+ public numHolder nHldr_vt_op2;
+ }
+
+ public static int Main()
+ {
+ bool passed = true;
+ //initialize class
+ CL cl1 = new CL();
+ //initialize struct
+ VT vt1;
+ vt1.i_vt_op1 = 16;
+ vt1.ui_vt_op1 = 16;
+ vt1.l_vt_op1 = 16;
+ vt1.ul_vt_op1 = 16;
+ vt1.f_vt_op1 = 16;
+ vt1.d_vt_op1 = 16;
+ vt1.m_vt_op1 = 16;
+ vt1.i_vt_op2 = 15;
+ vt1.ui_vt_op2 = 15;
+ vt1.l_vt_op2 = 15;
+ vt1.ul_vt_op2 = 15;
+ vt1.f_vt_op2 = 15;
+ vt1.d_vt_op2 = 15;
+ vt1.m_vt_op2 = 15;
+ vt1.nHldr_vt_op2 = new numHolder(15);
+
+ int[] i_arr1d_op1 = { 0, 16 };
+ int[,] i_arr2d_op1 = { { 0, 16 }, { 1, 1 } };
+ int[,,] i_arr3d_op1 = { { { 0, 16 }, { 1, 1 } } };
+ uint[] ui_arr1d_op1 = { 0, 16 };
+ uint[,] ui_arr2d_op1 = { { 0, 16 }, { 1, 1 } };
+ uint[,,] ui_arr3d_op1 = { { { 0, 16 }, { 1, 1 } } };
+ long[] l_arr1d_op1 = { 0, 16 };
+ long[,] l_arr2d_op1 = { { 0, 16 }, { 1, 1 } };
+ long[,,] l_arr3d_op1 = { { { 0, 16 }, { 1, 1 } } };
+ ulong[] ul_arr1d_op1 = { 0, 16 };
+ ulong[,] ul_arr2d_op1 = { { 0, 16 }, { 1, 1 } };
+ ulong[,,] ul_arr3d_op1 = { { { 0, 16 }, { 1, 1 } } };
+ float[] f_arr1d_op1 = { 0, 16 };
+ float[,] f_arr2d_op1 = { { 0, 16 }, { 1, 1 } };
+ float[,,] f_arr3d_op1 = { { { 0, 16 }, { 1, 1 } } };
+ double[] d_arr1d_op1 = { 0, 16 };
+ double[,] d_arr2d_op1 = { { 0, 16 }, { 1, 1 } };
+ double[,,] d_arr3d_op1 = { { { 0, 16 }, { 1, 1 } } };
+ decimal[] m_arr1d_op1 = { 0, 16 };
+ decimal[,] m_arr2d_op1 = { { 0, 16 }, { 1, 1 } };
+ decimal[,,] m_arr3d_op1 = { { { 0, 16 }, { 1, 1 } } };
+
+ int[] i_arr1d_op2 = { 15, 0, 1 };
+ int[,] i_arr2d_op2 = { { 0, 15 }, { 1, 1 } };
+ int[,,] i_arr3d_op2 = { { { 0, 15 }, { 1, 1 } } };
+ uint[] ui_arr1d_op2 = { 15, 0, 1 };
+ uint[,] ui_arr2d_op2 = { { 0, 15 }, { 1, 1 } };
+ uint[,,] ui_arr3d_op2 = { { { 0, 15 }, { 1, 1 } } };
+ long[] l_arr1d_op2 = { 15, 0, 1 };
+ long[,] l_arr2d_op2 = { { 0, 15 }, { 1, 1 } };
+ long[,,] l_arr3d_op2 = { { { 0, 15 }, { 1, 1 } } };
+ ulong[] ul_arr1d_op2 = { 15, 0, 1 };
+ ulong[,] ul_arr2d_op2 = { { 0, 15 }, { 1, 1 } };
+ ulong[,,] ul_arr3d_op2 = { { { 0, 15 }, { 1, 1 } } };
+ float[] f_arr1d_op2 = { 15, 0, 1 };
+ float[,] f_arr2d_op2 = { { 0, 15 }, { 1, 1 } };
+ float[,,] f_arr3d_op2 = { { { 0, 15 }, { 1, 1 } } };
+ double[] d_arr1d_op2 = { 15, 0, 1 };
+ double[,] d_arr2d_op2 = { { 0, 15 }, { 1, 1 } };
+ double[,,] d_arr3d_op2 = { { { 0, 15 }, { 1, 1 } } };
+ decimal[] m_arr1d_op2 = { 15, 0, 1 };
+ decimal[,] m_arr2d_op2 = { { 0, 15 }, { 1, 1 } };
+ decimal[,,] m_arr3d_op2 = { { { 0, 15 }, { 1, 1 } } };
+ numHolder[] nHldr_arr1d_op2 = { new numHolder(15), new numHolder(0), new numHolder(1) };
+ numHolder[,] nHldr_arr2d_op2 = { { new numHolder(0), new numHolder(15) }, { new numHolder(1), new numHolder(1) } };
+ numHolder[,,] nHldr_arr3d_op2 = { { { new numHolder(0), new numHolder(15) }, { new numHolder(1), new numHolder(1) } } };
+
+ int[,] index = { { 0, 0 }, { 1, 1 } };
+
+ {
+ int i_l_op1 = 16;
+ int i_l_op2 = 15;
+ uint ui_l_op2 = 15;
+ long l_l_op2 = 15;
+ ulong ul_l_op2 = 15;
+ float f_l_op2 = 15;
+ double d_l_op2 = 15;
+ decimal m_l_op2 = 15;
+ numHolder nHldr_l_op2 = new numHolder(15);
+ if ((i_l_op1 - i_l_op2 != i_l_op1 - ui_l_op2) || (i_l_op1 - ui_l_op2 != i_l_op1 - l_l_op2) || (i_l_op1 - l_l_op2 != i_l_op1 - (int)ul_l_op2) || (i_l_op1 - (int)ul_l_op2 != i_l_op1 - f_l_op2) || (i_l_op1 - f_l_op2 != i_l_op1 - d_l_op2) || ((decimal)(i_l_op1 - d_l_op2) != i_l_op1 - m_l_op2) || (i_l_op1 - m_l_op2 != i_l_op1 - i_l_op2) || (i_l_op1 - i_l_op2 != 1))
+ {
+ Console.WriteLine("testcase 1 failed");
+ passed = false;
+ }
+ if ((i_l_op1 - s_s_op2 != i_l_op1 - s_ui_s_op2) || (i_l_op1 - s_ui_s_op2 != i_l_op1 - s_s_op2) || (i_l_op1 - s_s_op2 != i_l_op1 - (int)s_ul_s_op2) || (i_l_op1 - (int)s_ul_s_op2 != i_l_op1 - s_s_op2) || (i_l_op1 - s_s_op2 != i_l_op1 - s_s_op2) || ((decimal)(i_l_op1 - s_s_op2) != i_l_op1 - s_s_op2) || (i_l_op1 - s_s_op2 != i_l_op1 - s_s_op2) || (i_l_op1 - s_s_op2 != 1))
+ {
+ Console.WriteLine("testcase 2 failed");
+ passed = false;
+ }
+ if ((s_s_op1 - i_l_op2 != s_s_op1 - ui_l_op2) || (s_s_op1 - ui_l_op2 != s_s_op1 - l_l_op2) || (s_s_op1 - l_l_op2 != s_s_op1 - (int)ul_l_op2) || (s_s_op1 - (int)ul_l_op2 != s_s_op1 - f_l_op2) || (s_s_op1 - f_l_op2 != s_s_op1 - d_l_op2) || ((decimal)(s_s_op1 - d_l_op2) != s_s_op1 - m_l_op2) || (s_s_op1 - m_l_op2 != s_s_op1 - i_l_op2) || (s_s_op1 - i_l_op2 != 1))
+ {
+ Console.WriteLine("testcase 3 failed");
+ passed = false;
+ }
+ if ((s_s_op1 - s_s_op2 != s_s_op1 - s_ui_s_op2) || (s_s_op1 - s_ui_s_op2 != s_s_op1 - s_s_op2) || (s_s_op1 - s_s_op2 != s_s_op1 - (int)s_ul_s_op2) || (s_s_op1 - (int)s_ul_s_op2 != s_s_op1 - s_s_op2) || (s_s_op1 - s_s_op2 != s_s_op1 - s_s_op2) || ((decimal)(s_s_op1 - s_s_op2) != s_s_op1 - s_s_op2) || (s_s_op1 - s_s_op2 != s_s_op1 - s_s_op2) || (s_s_op1 - s_s_op2 != 1))
+ {
+ Console.WriteLine("testcase 4 failed");
+ passed = false;
+ }
+ }
+
+ {
+ uint ui_l_op1 = 16;
+ int i_l_op2 = 15;
+ uint ui_l_op2 = 15;
+ long l_l_op2 = 15;
+ ulong ul_l_op2 = 15;
+ float f_l_op2 = 15;
+ double d_l_op2 = 15;
+ decimal m_l_op2 = 15;
+ numHolder nHldr_l_op2 = new numHolder(15);
+ if ((ui_l_op1 - i_l_op2 != ui_l_op1 - ui_l_op2) || (ui_l_op1 - ui_l_op2 != ui_l_op1 - l_l_op2) || ((ulong)(ui_l_op1 - l_l_op2) != ui_l_op1 - ul_l_op2) || (ui_l_op1 - ul_l_op2 != ui_l_op1 - f_l_op2) || (ui_l_op1 - f_l_op2 != ui_l_op1 - d_l_op2) || ((decimal)(ui_l_op1 - d_l_op2) != ui_l_op1 - m_l_op2) || (ui_l_op1 - m_l_op2 != ui_l_op1 - i_l_op2) || (ui_l_op1 - i_l_op2 != 1))
+ {
+ Console.WriteLine("testcase 5 failed");
+ passed = false;
+ }
+ if ((ui_l_op1 - s_s_op2 != ui_l_op1 - s_ui_s_op2) || (ui_l_op1 - s_ui_s_op2 != ui_l_op1 - s_s_op2) || ((ulong)(ui_l_op1 - s_s_op2) != ui_l_op1 - s_ul_s_op2) || (ui_l_op1 - s_ul_s_op2 != ui_l_op1 - s_s_op2) || (ui_l_op1 - s_s_op2 != ui_l_op1 - s_s_op2) || ((decimal)(ui_l_op1 - s_s_op2) != ui_l_op1 - s_s_op2) || (ui_l_op1 - s_s_op2 != ui_l_op1 - s_s_op2) || (ui_l_op1 - s_s_op2 != 1))
+ {
+ Console.WriteLine("testcase 6 failed");
+ passed = false;
+ }
+ if ((s_ui_s_op1 - i_l_op2 != s_ui_s_op1 - ui_l_op2) || (s_ui_s_op1 - ui_l_op2 != s_ui_s_op1 - l_l_op2) || ((ulong)(s_ui_s_op1 - l_l_op2) != s_ui_s_op1 - ul_l_op2) || (s_ui_s_op1 - ul_l_op2 != s_ui_s_op1 - f_l_op2) || (s_ui_s_op1 - f_l_op2 != s_ui_s_op1 - d_l_op2) || ((decimal)(s_ui_s_op1 - d_l_op2) != s_ui_s_op1 - m_l_op2) || (s_ui_s_op1 - m_l_op2 != s_ui_s_op1 - i_l_op2) || (s_ui_s_op1 - i_l_op2 != 1))
+ {
+ Console.WriteLine("testcase 7 failed");
+ passed = false;
+ }
+ if ((s_ui_s_op1 - s_s_op2 != s_ui_s_op1 - s_ui_s_op2) || (s_ui_s_op1 - s_ui_s_op2 != s_ui_s_op1 - s_s_op2) || ((ulong)(s_ui_s_op1 - s_s_op2) != s_ui_s_op1 - s_ul_s_op2) || (s_ui_s_op1 - s_ul_s_op2 != s_ui_s_op1 - s_s_op2) || (s_ui_s_op1 - s_s_op2 != s_ui_s_op1 - s_s_op2) || ((decimal)(s_ui_s_op1 - s_s_op2) != s_ui_s_op1 - s_s_op2) || (s_ui_s_op1 - s_s_op2 != s_ui_s_op1 - s_s_op2) || (s_ui_s_op1 - s_s_op2 != 1))
+ {
+ Console.WriteLine("testcase 8 failed");
+ passed = false;
+ }
+ }
+
+ {
+ long l_l_op1 = 16;
+ int i_l_op2 = 15;
+ uint ui_l_op2 = 15;
+ long l_l_op2 = 15;
+ ulong ul_l_op2 = 15;
+ float f_l_op2 = 15;
+ double d_l_op2 = 15;
+ decimal m_l_op2 = 15;
+ numHolder nHldr_l_op2 = new numHolder(15);
+ if ((l_l_op1 - i_l_op2 != l_l_op1 - ui_l_op2) || (l_l_op1 - ui_l_op2 != l_l_op1 - l_l_op2) || (l_l_op1 - l_l_op2 != l_l_op1 - (long)ul_l_op2) || (l_l_op1 - (long)ul_l_op2 != l_l_op1 - f_l_op2) || (l_l_op1 - f_l_op2 != l_l_op1 - d_l_op2) || ((decimal)(l_l_op1 - d_l_op2) != l_l_op1 - m_l_op2) || (l_l_op1 - m_l_op2 != l_l_op1 - i_l_op2) || (l_l_op1 - i_l_op2 != 1))
+ {
+ Console.WriteLine("testcase 9 failed");
+ passed = false;
+ }
+ if ((l_l_op1 - s_s_op2 != l_l_op1 - s_ui_s_op2) || (l_l_op1 - s_ui_s_op2 != l_l_op1 - s_s_op2) || (l_l_op1 - s_s_op2 != l_l_op1 - (long)s_ul_s_op2) || (l_l_op1 - (long)s_ul_s_op2 != l_l_op1 - s_s_op2) || (l_l_op1 - s_s_op2 != l_l_op1 - s_s_op2) || ((decimal)(l_l_op1 - s_s_op2) != l_l_op1 - s_s_op2) || (l_l_op1 - s_s_op2 != l_l_op1 - s_s_op2) || (l_l_op1 - s_s_op2 != 1))
+ {
+ Console.WriteLine("testcase 10 failed");
+ passed = false;
+ }
+ if ((s_s_op1 - i_l_op2 != s_s_op1 - ui_l_op2) || (s_s_op1 - ui_l_op2 != s_s_op1 - l_l_op2) || (s_s_op1 - l_l_op2 != s_s_op1 - (long)ul_l_op2) || (s_s_op1 - (long)ul_l_op2 != s_s_op1 - f_l_op2) || (s_s_op1 - f_l_op2 != s_s_op1 - d_l_op2) || ((decimal)(s_s_op1 - d_l_op2) != s_s_op1 - m_l_op2) || (s_s_op1 - m_l_op2 != s_s_op1 - i_l_op2) || (s_s_op1 - i_l_op2 != 1))
+ {
+ Console.WriteLine("testcase 11 failed");
+ passed = false;
+ }
+ if ((s_s_op1 - s_s_op2 != s_s_op1 - s_ui_s_op2) || (s_s_op1 - s_ui_s_op2 != s_s_op1 - s_s_op2) || (s_s_op1 - s_s_op2 != s_s_op1 - (long)s_ul_s_op2) || (s_s_op1 - (long)s_ul_s_op2 != s_s_op1 - s_s_op2) || (s_s_op1 - s_s_op2 != s_s_op1 - s_s_op2) || ((decimal)(s_s_op1 - s_s_op2) != s_s_op1 - s_s_op2) || (s_s_op1 - s_s_op2 != s_s_op1 - s_s_op2) || (s_s_op1 - s_s_op2 != 1))
+ {
+ Console.WriteLine("testcase 12 failed");
+ passed = false;
+ }
+ }
+
+ {
+ ulong ul_l_op1 = 16;
+ int i_l_op2 = 15;
+ uint ui_l_op2 = 15;
+ long l_l_op2 = 15;
+ ulong ul_l_op2 = 15;
+ float f_l_op2 = 15;
+ double d_l_op2 = 15;
+ decimal m_l_op2 = 15;
+ numHolder nHldr_l_op2 = new numHolder(15);
+ if ((ul_l_op1 - (ulong)i_l_op2 != ul_l_op1 - ui_l_op2) || (ul_l_op1 - ui_l_op2 != ul_l_op1 - (ulong)l_l_op2) || (ul_l_op1 - (ulong)l_l_op2 != ul_l_op1 - ul_l_op2) || (ul_l_op1 - ul_l_op2 != ul_l_op1 - f_l_op2) || (ul_l_op1 - f_l_op2 != ul_l_op1 - d_l_op2) || ((decimal)(ul_l_op1 - d_l_op2) != ul_l_op1 - m_l_op2) || (ul_l_op1 - m_l_op2 != ul_l_op1 - (ulong)i_l_op2) || (ul_l_op1 - (ulong)i_l_op2 != 1))
+ {
+ Console.WriteLine("testcase 13 failed");
+ passed = false;
+ }
+ if ((ul_l_op1 - (ulong)s_s_op2 != ul_l_op1 - s_ui_s_op2) || (ul_l_op1 - s_ui_s_op2 != ul_l_op1 - (ulong)s_s_op2) || (ul_l_op1 - (ulong)s_s_op2 != ul_l_op1 - s_ul_s_op2) || (ul_l_op1 - s_ul_s_op2 != ul_l_op1 - s_s_op2) || (ul_l_op1 - s_s_op2 != ul_l_op1 - s_s_op2) || ((decimal)(ul_l_op1 - s_s_op2) != ul_l_op1 - s_s_op2) || (ul_l_op1 - s_s_op2 != ul_l_op1 - (ulong)s_s_op2) || (ul_l_op1 - (ulong)s_s_op2 != 1))
+ {
+ Console.WriteLine("testcase 14 failed");
+ passed = false;
+ }
+ if ((s_ul_s_op1 - (ulong)i_l_op2 != s_ul_s_op1 - ui_l_op2) || (s_ul_s_op1 - ui_l_op2 != s_ul_s_op1 - (ulong)l_l_op2) || (s_ul_s_op1 - (ulong)l_l_op2 != s_ul_s_op1 - ul_l_op2) || (s_ul_s_op1 - ul_l_op2 != s_ul_s_op1 - f_l_op2) || (s_ul_s_op1 - f_l_op2 != s_ul_s_op1 - d_l_op2) || ((decimal)(s_ul_s_op1 - d_l_op2) != s_ul_s_op1 - m_l_op2) || (s_ul_s_op1 - m_l_op2 != s_ul_s_op1 - (ulong)i_l_op2) || (s_ul_s_op1 - (ulong)i_l_op2 != 1))
+ {
+ Console.WriteLine("testcase 15 failed");
+ passed = false;
+ }
+ if ((s_ul_s_op1 - (ulong)s_s_op2 != s_ul_s_op1 - s_ui_s_op2) || (s_ul_s_op1 - s_ui_s_op2 != s_ul_s_op1 - (ulong)s_s_op2) || (s_ul_s_op1 - (ulong)s_s_op2 != s_ul_s_op1 - s_ul_s_op2) || (s_ul_s_op1 - s_ul_s_op2 != s_ul_s_op1 - s_s_op2) || (s_ul_s_op1 - s_s_op2 != s_ul_s_op1 - s_s_op2) || ((decimal)(s_ul_s_op1 - s_s_op2) != s_ul_s_op1 - s_s_op2) || (s_ul_s_op1 - s_s_op2 != s_ul_s_op1 - (ulong)s_s_op2) || (s_ul_s_op1 - (ulong)s_s_op2 != 1))
+ {
+ Console.WriteLine("testcase 16 failed");
+ passed = false;
+ }
+ }
+
+ {
+ float f_l_op1 = 16;
+ int i_l_op2 = 15;
+ uint ui_l_op2 = 15;
+ long l_l_op2 = 15;
+ ulong ul_l_op2 = 15;
+ float f_l_op2 = 15;
+ double d_l_op2 = 15;
+ decimal m_l_op2 = 15;
+ numHolder nHldr_l_op2 = new numHolder(15);
+ if ((f_l_op1 - i_l_op2 != f_l_op1 - ui_l_op2) || (f_l_op1 - ui_l_op2 != f_l_op1 - l_l_op2) || (f_l_op1 - l_l_op2 != f_l_op1 - ul_l_op2) || (f_l_op1 - ul_l_op2 != f_l_op1 - f_l_op2) || (f_l_op1 - f_l_op2 != f_l_op1 - d_l_op2) || (f_l_op1 - d_l_op2 != f_l_op1 - (float)m_l_op2) || (f_l_op1 - (float)m_l_op2 != f_l_op1 - i_l_op2) || (f_l_op1 - i_l_op2 != 1))
+ {
+ Console.WriteLine("testcase 17 failed");
+ passed = false;
+ }
+ if ((f_l_op1 - s_s_op2 != f_l_op1 - s_ui_s_op2) || (f_l_op1 - s_ui_s_op2 != f_l_op1 - s_s_op2) || (f_l_op1 - s_s_op2 != f_l_op1 - s_ul_s_op2) || (f_l_op1 - s_ul_s_op2 != f_l_op1 - s_s_op2) || (f_l_op1 - s_s_op2 != f_l_op1 - s_s_op2) || (f_l_op1 - s_s_op2 != f_l_op1 - (float)s_s_op2) || (f_l_op1 - (float)s_s_op2 != f_l_op1 - s_s_op2) || (f_l_op1 - s_s_op2 != 1))
+ {
+ Console.WriteLine("testcase 18 failed");
+ passed = false;
+ }
+ if ((s_s_op1 - i_l_op2 != s_s_op1 - ui_l_op2) || (s_s_op1 - ui_l_op2 != s_s_op1 - l_l_op2) || (s_s_op1 - l_l_op2 != s_s_op1 - ul_l_op2) || (s_s_op1 - ul_l_op2 != s_s_op1 - f_l_op2) || (s_s_op1 - f_l_op2 != s_s_op1 - d_l_op2) || (s_s_op1 - d_l_op2 != s_s_op1 - (float)m_l_op2) || (s_s_op1 - (float)m_l_op2 != s_s_op1 - i_l_op2) || (s_s_op1 - i_l_op2 != 1))
+ {
+ Console.WriteLine("testcase 19 failed");
+ passed = false;
+ }
+ if ((s_s_op1 - s_s_op2 != s_s_op1 - s_ui_s_op2) || (s_s_op1 - s_ui_s_op2 != s_s_op1 - s_s_op2) || (s_s_op1 - s_s_op2 != s_s_op1 - s_ul_s_op2) || (s_s_op1 - s_ul_s_op2 != s_s_op1 - s_s_op2) || (s_s_op1 - s_s_op2 != s_s_op1 - s_s_op2) || (s_s_op1 - s_s_op2 != s_s_op1 - (float)s_s_op2) || (s_s_op1 - (float)s_s_op2 != s_s_op1 - s_s_op2) || (s_s_op1 - s_s_op2 != 1))
+ {
+ Console.WriteLine("testcase 20 failed");
+ passed = false;
+ }
+ }
+
+ {
+ double d_l_op1 = 16;
+ int i_l_op2 = 15;
+ uint ui_l_op2 = 15;
+ long l_l_op2 = 15;
+ ulong ul_l_op2 = 15;
+ float f_l_op2 = 15;
+ double d_l_op2 = 15;
+ decimal m_l_op2 = 15;
+ numHolder nHldr_l_op2 = new numHolder(15);
+ if ((d_l_op1 - i_l_op2 != d_l_op1 - ui_l_op2) || (d_l_op1 - ui_l_op2 != d_l_op1 - l_l_op2) || (d_l_op1 - l_l_op2 != d_l_op1 - ul_l_op2) || (d_l_op1 - ul_l_op2 != d_l_op1 - f_l_op2) || (d_l_op1 - f_l_op2 != d_l_op1 - d_l_op2) || (d_l_op1 - d_l_op2 != d_l_op1 - (double)m_l_op2) || (d_l_op1 - (double)m_l_op2 != d_l_op1 - i_l_op2) || (d_l_op1 - i_l_op2 != 1))
+ {
+ Console.WriteLine("testcase 21 failed");
+ passed = false;
+ }
+ if ((d_l_op1 - s_s_op2 != d_l_op1 - s_ui_s_op2) || (d_l_op1 - s_ui_s_op2 != d_l_op1 - s_s_op2) || (d_l_op1 - s_s_op2 != d_l_op1 - s_ul_s_op2) || (d_l_op1 - s_ul_s_op2 != d_l_op1 - s_s_op2) || (d_l_op1 - s_s_op2 != d_l_op1 - s_s_op2) || (d_l_op1 - s_s_op2 != d_l_op1 - (double)s_s_op2) || (d_l_op1 - (double)s_s_op2 != d_l_op1 - s_s_op2) || (d_l_op1 - s_s_op2 != 1))
+ {
+ Console.WriteLine("testcase 22 failed");
+ passed = false;
+ }
+ if ((s_s_op1 - i_l_op2 != s_s_op1 - ui_l_op2) || (s_s_op1 - ui_l_op2 != s_s_op1 - l_l_op2) || (s_s_op1 - l_l_op2 != s_s_op1 - ul_l_op2) || (s_s_op1 - ul_l_op2 != s_s_op1 - f_l_op2) || (s_s_op1 - f_l_op2 != s_s_op1 - d_l_op2) || (s_s_op1 - d_l_op2 != s_s_op1 - (double)m_l_op2) || (s_s_op1 - (double)m_l_op2 != s_s_op1 - i_l_op2) || (s_s_op1 - i_l_op2 != 1))
+ {
+ Console.WriteLine("testcase 23 failed");
+ passed = false;
+ }
+ if ((s_s_op1 - s_s_op2 != s_s_op1 - s_ui_s_op2) || (s_s_op1 - s_ui_s_op2 != s_s_op1 - s_s_op2) || (s_s_op1 - s_s_op2 != s_s_op1 - s_ul_s_op2) || (s_s_op1 - s_ul_s_op2 != s_s_op1 - s_s_op2) || (s_s_op1 - s_s_op2 != s_s_op1 - s_s_op2) || (s_s_op1 - s_s_op2 != s_s_op1 - (double)s_s_op2) || (s_s_op1 - (double)s_s_op2 != s_s_op1 - s_s_op2) || (s_s_op1 - s_s_op2 != 1))
+ {
+ Console.WriteLine("testcase 24 failed");
+ passed = false;
+ }
+ }
+
+ {
+ decimal m_l_op1 = 16;
+ int i_l_op2 = 15;
+ uint ui_l_op2 = 15;
+ long l_l_op2 = 15;
+ ulong ul_l_op2 = 15;
+ float f_l_op2 = 15;
+ double d_l_op2 = 15;
+ decimal m_l_op2 = 15;
+ numHolder nHldr_l_op2 = new numHolder(15);
+ if ((m_l_op1 - i_l_op2 != m_l_op1 - ui_l_op2) || (m_l_op1 - ui_l_op2 != m_l_op1 - l_l_op2) || (m_l_op1 - l_l_op2 != m_l_op1 - ul_l_op2) || (m_l_op1 - ul_l_op2 != m_l_op1 - (decimal)f_l_op2) || (m_l_op1 - (decimal)f_l_op2 != m_l_op1 - (decimal)d_l_op2) || (m_l_op1 - (decimal)d_l_op2 != m_l_op1 - m_l_op2) || (m_l_op1 - m_l_op2 != m_l_op1 - i_l_op2) || (m_l_op1 - i_l_op2 != 1))
+ {
+ Console.WriteLine("testcase 25 failed");
+ passed = false;
+ }
+ if ((m_l_op1 - s_s_op2 != m_l_op1 - s_ui_s_op2) || (m_l_op1 - s_ui_s_op2 != m_l_op1 - s_s_op2) || (m_l_op1 - s_s_op2 != m_l_op1 - s_ul_s_op2) || (m_l_op1 - s_ul_s_op2 != m_l_op1 - (decimal)s_s_op2) || (m_l_op1 - (decimal)s_s_op2 != m_l_op1 - (decimal)s_s_op2) || (m_l_op1 - (decimal)s_s_op2 != m_l_op1 - s_s_op2) || (m_l_op1 - s_s_op2 != m_l_op1 - s_s_op2) || (m_l_op1 - s_s_op2 != 1))
+ {
+ Console.WriteLine("testcase 26 failed");
+ passed = false;
+ }
+ if ((s_s_op1 - i_l_op2 != s_s_op1 - ui_l_op2) || (s_s_op1 - ui_l_op2 != s_s_op1 - l_l_op2) || (s_s_op1 - l_l_op2 != s_s_op1 - ul_l_op2) || (s_s_op1 - ul_l_op2 != s_s_op1 - (decimal)f_l_op2) || (s_s_op1 - (decimal)f_l_op2 != s_s_op1 - (decimal)d_l_op2) || (s_s_op1 - (decimal)d_l_op2 != s_s_op1 - m_l_op2) || (s_s_op1 - m_l_op2 != s_s_op1 - i_l_op2) || (s_s_op1 - i_l_op2 != 1))
+ {
+ Console.WriteLine("testcase 27 failed");
+ passed = false;
+ }
+ if ((s_s_op1 - s_s_op2 != s_s_op1 - s_ui_s_op2) || (s_s_op1 - s_ui_s_op2 != s_s_op1 - s_s_op2) || (s_s_op1 - s_s_op2 != s_s_op1 - s_ul_s_op2) || (s_s_op1 - s_ul_s_op2 != s_s_op1 - (decimal)s_s_op2) || (s_s_op1 - (decimal)s_s_op2 != s_s_op1 - (decimal)s_s_op2) || (s_s_op1 - (decimal)s_s_op2 != s_s_op1 - s_s_op2) || (s_s_op1 - s_s_op2 != s_s_op1 - s_s_op2) || (s_s_op1 - s_s_op2 != 1))
+ {
+ Console.WriteLine("testcase 28 failed");
+ passed = false;
+ }
+ }
+
+ if (!passed)
+ {
+ Console.WriteLine("FAILED");
+ return 1;
+ }
+ else
+ {
+ Console.WriteLine("PASSED");
+ return 100;
+ }
+ }
+}
diff --git a/tests/src/JIT/Directed/coverage/oldtests/oldtests.csproj b/tests/src/JIT/Directed/coverage/oldtests/oldtests.csproj
new file mode 100644
index 0000000000..33b2928ebc
--- /dev/null
+++ b/tests/src/JIT/Directed/coverage/oldtests/oldtests.csproj
@@ -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>
diff --git a/tests/src/JIT/Directed/coverage/oldtests/packages.config b/tests/src/JIT/Directed/coverage/oldtests/packages.config
new file mode 100644
index 0000000000..06d3d11ead
--- /dev/null
+++ b/tests/src/JIT/Directed/coverage/oldtests/packages.config
@@ -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>
diff --git a/tests/src/JIT/Directed/intrinsic/interlocked/IntrinsicTest_Overflow.cs b/tests/src/JIT/Directed/intrinsic/interlocked/IntrinsicTest_Overflow.cs
new file mode 100644
index 0000000000..21d87f12d4
--- /dev/null
+++ b/tests/src/JIT/Directed/intrinsic/interlocked/IntrinsicTest_Overflow.cs
@@ -0,0 +1,147 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+//
+
+// Checks that there are no overflows for the interlocked intrinsics generated.
+
+using System;
+using System.Threading;
+using System.Runtime.CompilerServices;
+public class IntrinsicTest
+{
+ private static int s_counter = 3245;
+ private int _instanceCounter;
+ private static long s_counter64 = 3245;
+ private long _instanceCounter64;
+ private static int s_id_counter = 3245;
+ private int _id_instanceCounter;
+ private static long s_id_counter64 = 3245;
+ private long _id_instanceCounter64;
+ private static long s_temp = 1111;
+
+ private static long s_idmp = 1111;
+ private static long s_idjunk = 0;
+ [MethodImpl(MethodImplOptions.NoInlining)]
+
+ private IntrinsicTest() { _instanceCounter = 3245; _instanceCounter64 = 3245; _id_instanceCounter = 3245; _id_instanceCounter64 = 3245; }
+ public int GetValue() { s_temp++; return (int)0x1ceddeed; }
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
+
+ public int id_GetValue() { s_idmp++; return (int)0x1ceddeed; }
+
+ public static bool MainTest()
+ {
+ int te0 = Int32.MaxValue, te1 = 4325, te2 = 4325, te3 = 2134;
+ long te064 = 454562, te164 = 345653, te264 = 345653, te364 = 345564;
+ int dummy = 4355;
+ long dummy64 = 656342;
+ int id0 = -1, id1 = 4325, id2 = 4325, id3 = 2134;
+ long id064 = 454562, id164 = 345653, id264 = 345653, id364 = 345564;
+ int idummy = 4355;
+ long idummy64 = 656342;
+ bool fail = false;
+ IntrinsicTest Dummy = new IntrinsicTest();
+
+
+ te0 = Interlocked.Increment(ref te0);
+ id0 = Int32.MinValue;
+ Console.WriteLine("------------------------------------INC 0 0 0 0");
+ if (te0 != id0) { fail = true; Console.WriteLine("te0 check failed {0} {1}", te0, id0); }
+ if (te1 != id1) { fail = true; Console.WriteLine("te1 check failed {0} {1}", te1, id1); }
+ if (te2 != id2) { fail = true; Console.WriteLine("te2 check failed {0} {1}", te2, id2); }
+ if (te3 != id3) { fail = true; Console.WriteLine("te3 check failed {0} {1}", te3, id3); }
+ if (te064 != id064) { fail = true; Console.WriteLine("te064 check failed {0} {1}", te064, id064); }
+ if (te164 != id164) { fail = true; Console.WriteLine("te164 check failed {0} {1}", te164, id164); }
+ if (te264 != id264) { fail = true; Console.WriteLine("te264 check failed {0} {1}", te264, id264); }
+ if (te364 != id364) { fail = true; Console.WriteLine("te364 check failed {0} {1}", te364, id364); }
+ if (dummy != idummy) { fail = true; Console.WriteLine("dummy check failed {0} {1}", dummy, idummy); }
+ if (dummy64 != idummy64) { fail = true; Console.WriteLine("dummy64 check failed {0} {1}", dummy64, idummy64); }
+
+ if (s_counter != s_id_counter) { Console.WriteLine("counter mismatch {0} {1}", s_counter, s_id_counter); fail = true; }
+ if (s_counter64 != s_id_counter64) { Console.WriteLine("counter64 mismatch {0} {1}", s_counter64, s_id_counter64); fail = true; }
+ if (Dummy._instanceCounter != Dummy._id_instanceCounter) { Console.WriteLine("instanceCounter mismatch {0} {1}", Dummy._instanceCounter, Dummy._id_instanceCounter); fail = true; }
+ if (Dummy._instanceCounter64 != Dummy._id_instanceCounter64) { Console.WriteLine("instanceCounter64 mismatch {0} {1}", Dummy._instanceCounter64, Dummy._id_instanceCounter64); fail = true; }
+ if (s_temp != s_idmp) { Console.WriteLine("temp mismatch {0} {1}", s_temp, s_idmp); fail = true; }
+
+ te0 = Interlocked.Decrement(ref te0);
+ id0 = Int32.MaxValue;
+ Console.WriteLine("------------------------------------DEC 0 0 0 0");
+ if (te0 != id0) { fail = true; Console.WriteLine("te0 check failed {0} {1}", te0, id0); }
+ if (te1 != id1) { fail = true; Console.WriteLine("te1 check failed {0} {1}", te1, id1); }
+ if (te2 != id2) { fail = true; Console.WriteLine("te2 check failed {0} {1}", te2, id2); }
+ if (te3 != id3) { fail = true; Console.WriteLine("te3 check failed {0} {1}", te3, id3); }
+ if (te064 != id064) { fail = true; Console.WriteLine("te064 check failed {0} {1}", te064, id064); }
+ if (te164 != id164) { fail = true; Console.WriteLine("te164 check failed {0} {1}", te164, id164); }
+ if (te264 != id264) { fail = true; Console.WriteLine("te264 check failed {0} {1}", te264, id264); }
+ if (te364 != id364) { fail = true; Console.WriteLine("te364 check failed {0} {1}", te364, id364); }
+ if (dummy != idummy) { fail = true; Console.WriteLine("dummy check failed {0} {1}", dummy, idummy); }
+ if (dummy64 != idummy64) { fail = true; Console.WriteLine("dummy64 check failed {0} {1}", dummy64, idummy64); }
+
+ if (s_counter != s_id_counter) { Console.WriteLine("counter mismatch {0} {1}", s_counter, s_id_counter); fail = true; }
+ if (s_counter64 != s_id_counter64) { Console.WriteLine("counter64 mismatch {0} {1}", s_counter64, s_id_counter64); fail = true; }
+ if (Dummy._instanceCounter != Dummy._id_instanceCounter) { Console.WriteLine("instanceCounter mismatch {0} {1}", Dummy._instanceCounter, Dummy._id_instanceCounter); fail = true; }
+ if (Dummy._instanceCounter64 != Dummy._id_instanceCounter64) { Console.WriteLine("instanceCounter64 mismatch {0} {1}", Dummy._instanceCounter64, Dummy._id_instanceCounter64); fail = true; }
+ if (s_temp != s_idmp) { Console.WriteLine("temp mismatch {0} {1}", s_temp, s_idmp); fail = true; }
+
+ te0 = Int32.MaxValue;
+ id0 = Int32.MinValue;
+ te0 = Interlocked.Add(ref te0, 1);
+ Console.WriteLine("------------------------------------XADD 0 0 0 0");
+ if (te0 != id0) { fail = true; Console.WriteLine("te0 check failed {0} {1}", te0, id0); }
+ if (te1 != id1) { fail = true; Console.WriteLine("te1 check failed {0} {1}", te1, id1); }
+ if (te2 != id2) { fail = true; Console.WriteLine("te2 check failed {0} {1}", te2, id2); }
+ if (te3 != id3) { fail = true; Console.WriteLine("te3 check failed {0} {1}", te3, id3); }
+ if (te064 != id064) { fail = true; Console.WriteLine("te064 check failed {0} {1}", te064, id064); }
+ if (te164 != id164) { fail = true; Console.WriteLine("te164 check failed {0} {1}", te164, id164); }
+ if (te264 != id264) { fail = true; Console.WriteLine("te264 check failed {0} {1}", te264, id264); }
+ if (te364 != id364) { fail = true; Console.WriteLine("te364 check failed {0} {1}", te364, id364); }
+ if (dummy != idummy) { fail = true; Console.WriteLine("dummy check failed {0} {1}", dummy, idummy); }
+ if (dummy64 != idummy64) { fail = true; Console.WriteLine("dummy64 check failed {0} {1}", dummy64, idummy64); }
+
+ if (s_counter != s_id_counter) { Console.WriteLine("counter mismatch {0} {1}", s_counter, s_id_counter); fail = true; }
+ if (s_counter64 != s_id_counter64) { Console.WriteLine("counter64 mismatch {0} {1}", s_counter64, s_id_counter64); fail = true; }
+ if (Dummy._instanceCounter != Dummy._id_instanceCounter) { Console.WriteLine("instanceCounter mismatch {0} {1}", Dummy._instanceCounter, Dummy._id_instanceCounter); fail = true; }
+ if (Dummy._instanceCounter64 != Dummy._id_instanceCounter64) { Console.WriteLine("instanceCounter64 mismatch {0} {1}", Dummy._instanceCounter64, Dummy._id_instanceCounter64); fail = true; }
+ if (s_temp != s_idmp) { Console.WriteLine("temp mismatch {0} {1}", s_temp, s_idmp); fail = true; }
+
+ te0 = Int32.MinValue;
+ id0 = Int32.MaxValue;
+ te0 = Interlocked.Add(ref te0, -1);
+ Console.WriteLine("------------------------------------XADD 0 0 0 0");
+ if (te0 != id0) { fail = true; Console.WriteLine("te0 check failed {0} {1}", te0, id0); }
+ if (te1 != id1) { fail = true; Console.WriteLine("te1 check failed {0} {1}", te1, id1); }
+ if (te2 != id2) { fail = true; Console.WriteLine("te2 check failed {0} {1}", te2, id2); }
+ if (te3 != id3) { fail = true; Console.WriteLine("te3 check failed {0} {1}", te3, id3); }
+ if (te064 != id064) { fail = true; Console.WriteLine("te064 check failed {0} {1}", te064, id064); }
+ if (te164 != id164) { fail = true; Console.WriteLine("te164 check failed {0} {1}", te164, id164); }
+ if (te264 != id264) { fail = true; Console.WriteLine("te264 check failed {0} {1}", te264, id264); }
+ if (te364 != id364) { fail = true; Console.WriteLine("te364 check failed {0} {1}", te364, id364); }
+ if (dummy != idummy) { fail = true; Console.WriteLine("dummy check failed {0} {1}", dummy, idummy); }
+ if (dummy64 != idummy64) { fail = true; Console.WriteLine("dummy64 check failed {0} {1}", dummy64, idummy64); }
+
+ if (s_counter != s_id_counter) { Console.WriteLine("counter mismatch {0} {1}", s_counter, s_id_counter); fail = true; }
+ if (s_counter64 != s_id_counter64) { Console.WriteLine("counter64 mismatch {0} {1}", s_counter64, s_id_counter64); fail = true; }
+ if (Dummy._instanceCounter != Dummy._id_instanceCounter) { Console.WriteLine("instanceCounter mismatch {0} {1}", Dummy._instanceCounter, Dummy._id_instanceCounter); fail = true; }
+ if (Dummy._instanceCounter64 != Dummy._id_instanceCounter64) { Console.WriteLine("instanceCounter64 mismatch {0} {1}", Dummy._instanceCounter64, Dummy._id_instanceCounter64); fail = true; }
+ if (s_temp != s_idmp) { Console.WriteLine("temp mismatch {0} {1}", s_temp, s_idmp); fail = true; }
+
+ return fail;
+ }
+
+ private static int Main()
+ {
+ if (MainTest())
+ {
+ Console.WriteLine("Test Failed");
+ return 101;
+ }
+ else
+ {
+ Console.WriteLine("Test Passed");
+ return 100;
+ }
+ }
+}
+;
+
diff --git a/tests/src/JIT/Directed/intrinsic/interlocked/app.config b/tests/src/JIT/Directed/intrinsic/interlocked/app.config
new file mode 100644
index 0000000000..62803f5972
--- /dev/null
+++ b/tests/src/JIT/Directed/intrinsic/interlocked/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> \ No newline at end of file
diff --git a/tests/src/JIT/Directed/intrinsic/interlocked/cmpxchg.cs b/tests/src/JIT/Directed/intrinsic/interlocked/cmpxchg.cs
new file mode 100644
index 0000000000..99ab9cb9ee
--- /dev/null
+++ b/tests/src/JIT/Directed/intrinsic/interlocked/cmpxchg.cs
@@ -0,0 +1,54 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+//
+
+using System;
+using System.Threading;
+using System.Runtime.CompilerServices;
+public class CMPXCHG
+{
+ public static int g_static = -1;
+ public static void Function(int bit, bool value)
+ {
+ for (; ;)
+ {
+ int oldData = g_static;
+ int newData;
+ if (value)
+ {
+ newData = oldData | bit;
+ }
+ else
+ {
+ newData = oldData & ~bit;
+ }
+
+#pragma warning disable 0420
+ int result = Interlocked.CompareExchange(ref g_static, newData, oldData);
+#pragma warning restore 0420
+
+ if (result == oldData)
+ {
+ return;
+ }
+ }
+ }
+ public static int Main()
+ {
+ for (int i = 0; i < 10; ++i)
+ {
+ if (g_static < 10)
+ {
+ Function(7, true);
+ }
+ if (g_static < 9)
+ {
+ Function(11, false);
+ }
+ if (g_static < 8)
+ Function(12, false);
+ }
+ return 100;
+ //If we dont reach here, we have a problem!
+ }
+}
diff --git a/tests/src/JIT/Directed/intrinsic/interlocked/cs_template.proj b/tests/src/JIT/Directed/intrinsic/interlocked/cs_template.proj
new file mode 100644
index 0000000000..adc2f21e14
--- /dev/null
+++ b/tests/src/JIT/Directed/intrinsic/interlocked/cs_template.proj
@@ -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>
diff --git a/tests/src/JIT/Directed/intrinsic/interlocked/cse_cmpxchg.cs b/tests/src/JIT/Directed/intrinsic/interlocked/cse_cmpxchg.cs
new file mode 100644
index 0000000000..d8f609cacf
--- /dev/null
+++ b/tests/src/JIT/Directed/intrinsic/interlocked/cse_cmpxchg.cs
@@ -0,0 +1,26 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+//
+
+using System;
+using System.Threading;
+using System.Runtime.CompilerServices;
+internal class Foo
+{
+ private static int s_taskIdCounter;
+ private int _taskId = 0;
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ public int Function()
+ {
+ if (_taskId == 0)
+ {
+ int newId = Interlocked.Increment(ref s_taskIdCounter);
+ Interlocked.CompareExchange(ref _taskId, newId, 0);
+ }
+ return _taskId;
+ }
+ public static int Main()
+ {
+ if (new Foo().Function() == 1) return 100; else return 101;
+ }
+}
diff --git a/tests/src/JIT/Directed/intrinsic/interlocked/interlocked.csproj b/tests/src/JIT/Directed/intrinsic/interlocked/interlocked.csproj
new file mode 100644
index 0000000000..33b2928ebc
--- /dev/null
+++ b/tests/src/JIT/Directed/intrinsic/interlocked/interlocked.csproj
@@ -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>
diff --git a/tests/src/JIT/Directed/intrinsic/interlocked/nullchecksuppress.cs b/tests/src/JIT/Directed/intrinsic/interlocked/nullchecksuppress.cs
new file mode 100644
index 0000000000..3d6c133957
--- /dev/null
+++ b/tests/src/JIT/Directed/intrinsic/interlocked/nullchecksuppress.cs
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+//
+
+using System;
+using System.Threading;
+using System.Runtime.CompilerServices;
+public class NCS
+{
+ public int field;
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ public static int Increment(ref int value)
+ {
+ return Interlocked.Increment(ref value);
+ }
+ public static int Decrement(ref int value)
+ {
+ return Interlocked.Decrement(ref value);
+ }
+ public static int Add(ref int value, int other)
+ {
+ return Interlocked.Add(ref value, other);
+ }
+ public static int CompareExchange(ref int value, int newData, int oldData)
+ {
+ return Interlocked.CompareExchange(ref value, newData, oldData);
+ }
+
+ public static int Main()
+ {
+ NCS ncs = new NCS();
+ ncs.field = 99;
+ CompareExchange(ref ncs.field, 105, 99);
+ Decrement(ref ncs.field);
+ Add(ref ncs.field, -5);
+ Increment(ref ncs.field);
+ return ncs.field;
+ }
+}
diff --git a/tests/src/JIT/Directed/intrinsic/interlocked/packages.config b/tests/src/JIT/Directed/intrinsic/interlocked/packages.config
new file mode 100644
index 0000000000..c530dff390
--- /dev/null
+++ b/tests/src/JIT/Directed/intrinsic/interlocked/packages.config
@@ -0,0 +1,7 @@
+<?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" />
+ <package id="System.Threading" version="4.0.0-beta-22412" />
+</packages>
diff --git a/tests/src/JIT/Directed/intrinsic/interlocked/regalloc1.cs b/tests/src/JIT/Directed/intrinsic/interlocked/regalloc1.cs
new file mode 100644
index 0000000000..c82fef30fb
--- /dev/null
+++ b/tests/src/JIT/Directed/intrinsic/interlocked/regalloc1.cs
@@ -0,0 +1,77 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+//
+
+using System;
+using System.Threading;
+using System.Runtime.CompilerServices;
+public class IntrinsicTest
+{
+ private static int s_counter;
+ private int _instanceCounter;
+ private static long s_counter64;
+ private long _instanceCounter64;
+ private static int s_id_counter;
+ private int _id_instanceCounter;
+ private static long s_id_counter64;
+ private long _id_instanceCounter64;
+ private static long s_temp = 1111;
+
+ private static long s_idmp = 1111;[MethodImpl(MethodImplOptions.NoInlining)]
+
+ public int GetValue() { s_temp++; return (int)0x1ceddeed; }
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
+
+ public int id_GetValue() { s_idmp++; return (int)0x1ceddeed; }
+
+ public static bool MainTest()
+ {
+ int te0 = 3245, te1 = 4325, te2 = 4325, te3 = 2134;
+ long te064 = 454562, te164 = 345653, te264 = 345653, te364 = 345564;
+ int dummy = 4355;
+ long dummy64 = 656342;
+ int id0 = 3245, id1 = 4325, id2 = 4325, id3 = 2134;
+ long id064 = 454562, id164 = 345653, id264 = 345653, id364 = 345564;
+ int idummy = 4355;
+ long idummy64 = 656342;
+ bool fail = false;
+ IntrinsicTest Dummy = new IntrinsicTest();
+
+ te0 = Interlocked.CompareExchange(ref s_counter, te0, Dummy.GetValue());
+ id0 = s_id_counter; s_id_counter = (s_id_counter == Dummy.id_GetValue()) ? id0 : s_id_counter;
+ Console.WriteLine("------------------------------------CMPXCHG 1 0 3 0");
+ if (te0 != id0) { fail = true; Console.WriteLine("te0 check failed {0} {1}", te0, id0); }
+ if (te1 != id1) { fail = true; Console.WriteLine("te1 check failed {0} {1}", te1, id1); }
+ if (te2 != id2) { fail = true; Console.WriteLine("te2 check failed {0} {1}", te2, id2); }
+ if (te3 != id3) { fail = true; Console.WriteLine("te3 check failed {0} {1}", te3, id3); }
+ if (te064 != id064) { fail = true; Console.WriteLine("te064 check failed {0} {1}", te064, id064); }
+ if (te164 != id164) { fail = true; Console.WriteLine("te164 check failed {0} {1}", te164, id164); }
+ if (te264 != id264) { fail = true; Console.WriteLine("te264 check failed {0} {1}", te264, id264); }
+ if (te364 != id364) { fail = true; Console.WriteLine("te364 check failed {0} {1}", te364, id364); }
+ if (dummy != idummy) { fail = true; Console.WriteLine("dummy check failed {0} {1}", dummy, idummy); }
+ if (dummy64 != idummy64) { fail = true; Console.WriteLine("dummy64 check failed {0} {1}", dummy64, idummy64); }
+
+ if (s_counter != s_id_counter) { Console.WriteLine("counter mismatch {0} {1}", s_counter, s_id_counter); fail = true; }
+ if (s_counter64 != s_id_counter64) { Console.WriteLine("counter64 mismatch {0} {1}", s_counter64, s_id_counter64); fail = true; }
+ if (Dummy._instanceCounter != Dummy._id_instanceCounter) { Console.WriteLine("instanceCounter mismatch {0} {1}", Dummy._instanceCounter, Dummy._id_instanceCounter); fail = true; }
+ if (Dummy._instanceCounter64 != Dummy._id_instanceCounter64) { Console.WriteLine("instanceCounter64 mismatch {0} {1}", Dummy._instanceCounter64, Dummy._id_instanceCounter64); fail = true; }
+ if (s_temp != s_idmp) { Console.WriteLine("temp mismatch {0} {1}", s_temp, s_idmp); fail = true; }
+ return fail;
+ }
+
+ private static int Main()
+ {
+ if (MainTest())
+ {
+ Console.WriteLine("Test Failed");
+ return 101;
+ }
+ else
+ {
+ Console.WriteLine("Test Passed");
+ return 100;
+ }
+ }
+}
+
diff --git a/tests/src/JIT/Directed/intrinsic/interlocked/regalloc2.cs b/tests/src/JIT/Directed/intrinsic/interlocked/regalloc2.cs
new file mode 100644
index 0000000000..096e6ee246
--- /dev/null
+++ b/tests/src/JIT/Directed/intrinsic/interlocked/regalloc2.cs
@@ -0,0 +1,78 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+//
+
+using System;
+using System.Threading;
+using System.Runtime.CompilerServices;
+public class IntrinsicTest
+{
+ private static int s_counter;
+ private int _instanceCounter;
+ private static long s_counter64;
+ private long _instanceCounter64;
+ private static int s_id_counter;
+ private int _id_instanceCounter;
+ private static long s_id_counter64;
+ private long _id_instanceCounter64;
+ private static long s_temp = 1111;
+
+ private static long s_idmp = 1111;
+ private static long s_idjunk = 0;
+ [MethodImpl(MethodImplOptions.NoInlining)]
+
+ public int GetValue() { s_temp++; return (int)0x1ceddeed; }
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
+
+ public int id_GetValue() { s_idmp++; return (int)0x1ceddeed; }
+
+ public static bool MainTest()
+ {
+ int te0 = 3245, te1 = 4325, te2 = 4325, te3 = 2134;
+ long te064 = 454562, te164 = 345653, te264 = 345653, te364 = 345564;
+ int dummy = 4355;
+ long dummy64 = 656342;
+ int id0 = 3245, id1 = 4325, id2 = 4325, id3 = 2134;
+ long id064 = 454562, id164 = 345653, id264 = 345653, id364 = 345564;
+ int idummy = 4355;
+ long idummy64 = 656342;
+ bool fail = false;
+ IntrinsicTest Dummy = new IntrinsicTest();
+ te0 = Interlocked.CompareExchange(ref te0, Dummy.GetValue(), te0);
+ id0 = id0; if ((id0 == id0)) s_idjunk = Dummy.id_GetValue(); else s_idjunk = Dummy.id_GetValue();
+ Console.WriteLine("------------------------------------CMPXCHG 0 3 0 0");
+ if (te0 != id0) { fail = true; Console.WriteLine("te0 check failed {0} {1}", te0, id0); }
+ if (te1 != id1) { fail = true; Console.WriteLine("te1 check failed {0} {1}", te1, id1); }
+ if (te2 != id2) { fail = true; Console.WriteLine("te2 check failed {0} {1}", te2, id2); }
+ if (te3 != id3) { fail = true; Console.WriteLine("te3 check failed {0} {1}", te3, id3); }
+ if (te064 != id064) { fail = true; Console.WriteLine("te064 check failed {0} {1}", te064, id064); }
+ if (te164 != id164) { fail = true; Console.WriteLine("te164 check failed {0} {1}", te164, id164); }
+ if (te264 != id264) { fail = true; Console.WriteLine("te264 check failed {0} {1}", te264, id264); }
+ if (te364 != id364) { fail = true; Console.WriteLine("te364 check failed {0} {1}", te364, id364); }
+ if (dummy != idummy) { fail = true; Console.WriteLine("dummy check failed {0} {1}", dummy, idummy); }
+ if (dummy64 != idummy64) { fail = true; Console.WriteLine("dummy64 check failed {0} {1}", dummy64, idummy64); }
+
+ if (s_counter != s_id_counter) { Console.WriteLine("counter mismatch {0} {1}", s_counter, s_id_counter); fail = true; }
+ if (s_counter64 != s_id_counter64) { Console.WriteLine("counter64 mismatch {0} {1}", s_counter64, s_id_counter64); fail = true; }
+ if (Dummy._instanceCounter != Dummy._id_instanceCounter) { Console.WriteLine("instanceCounter mismatch {0} {1}", Dummy._instanceCounter, Dummy._id_instanceCounter); fail = true; }
+ if (Dummy._instanceCounter64 != Dummy._id_instanceCounter64) { Console.WriteLine("instanceCounter64 mismatch {0} {1}", Dummy._instanceCounter64, Dummy._id_instanceCounter64); fail = true; }
+ if (s_temp != s_idmp) { Console.WriteLine("temp mismatch {0} {1}", s_temp, s_idmp); fail = true; }
+ return fail;
+ }
+
+ private static int Main()
+ {
+ if (MainTest())
+ {
+ Console.WriteLine("Test Failed");
+ return 101;
+ }
+ else
+ {
+ Console.WriteLine("Test Passed");
+ return 100;
+ }
+ }
+}
+
diff --git a/tests/src/JIT/Directed/intrinsic/pow/app.config b/tests/src/JIT/Directed/intrinsic/pow/app.config
new file mode 100644
index 0000000000..62803f5972
--- /dev/null
+++ b/tests/src/JIT/Directed/intrinsic/pow/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> \ No newline at end of file
diff --git a/tests/src/JIT/Directed/intrinsic/pow/cs_template.proj b/tests/src/JIT/Directed/intrinsic/pow/cs_template.proj
new file mode 100644
index 0000000000..adc2f21e14
--- /dev/null
+++ b/tests/src/JIT/Directed/intrinsic/pow/cs_template.proj
@@ -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>
diff --git a/tests/src/JIT/Directed/intrinsic/pow/packages.config b/tests/src/JIT/Directed/intrinsic/pow/packages.config
new file mode 100644
index 0000000000..06d3d11ead
--- /dev/null
+++ b/tests/src/JIT/Directed/intrinsic/pow/packages.config
@@ -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>
diff --git a/tests/src/JIT/Directed/intrinsic/pow/pow.csproj b/tests/src/JIT/Directed/intrinsic/pow/pow.csproj
new file mode 100644
index 0000000000..33b2928ebc
--- /dev/null
+++ b/tests/src/JIT/Directed/intrinsic/pow/pow.csproj
@@ -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>
diff --git a/tests/src/JIT/Directed/intrinsic/pow/pow0.cs b/tests/src/JIT/Directed/intrinsic/pow/pow0.cs
new file mode 100644
index 0000000000..744777fc0e
--- /dev/null
+++ b/tests/src/JIT/Directed/intrinsic/pow/pow0.cs
@@ -0,0 +1,64 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+//
+
+//simple and recursive call
+
+using System;
+
+internal class pow0
+{
+ public static int Main()
+ {
+ bool pass = true;
+ double x, y, z;
+ double n;
+
+ y = 0;
+ z = 0;
+ for (n = 1; n < 500; n++)
+ y += Math.Pow(n, 2);
+
+ n = n - 1;
+
+ z = n * (n + 1) * (2 * n + 1) / 6.0;
+ if (y != z)
+ {
+ Console.WriteLine("n: {0}, y: {1}, z: {2}", n, y, z);
+ pass = false;
+ }
+
+ x = 1;
+ for (n = 1; n < 100000;)
+ {
+ n += Math.Pow(n, 0);
+ if (n != ++x)
+ {
+ Console.WriteLine("n is {0}", n);
+ pass = false;
+ }
+ }
+
+ x = 2;
+ for (n = 1; n < 20; n++)
+ x *= Math.Pow(2, n);
+
+ if (x != 3.1385508676933404E57)
+ {
+ Console.WriteLine("x is {0}, should be 3.1385508676933404E57", x);
+ pass = false;
+ }
+
+ if (pass)
+ {
+ Console.WriteLine("PASSED");
+ return 100;
+ }
+ else
+ {
+ Console.WriteLine("FAILED");
+ return 1;
+ }
+ }
+}
+
diff --git a/tests/src/JIT/Directed/intrinsic/pow/pow1.cs b/tests/src/JIT/Directed/intrinsic/pow/pow1.cs
new file mode 100644
index 0000000000..4fffad9233
--- /dev/null
+++ b/tests/src/JIT/Directed/intrinsic/pow/pow1.cs
@@ -0,0 +1,151 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+//
+
+//Testing the special values
+
+using System;
+
+internal class pow1
+{
+ public static int Main()
+ {
+ double x, y, z;
+ bool pass = true;
+
+ //Check if the test is being executed on ARM
+ bool isProcessorArm = false;
+
+#if CORECLR
+ if (TestLibrary.Env.GetEnvVariable("PROCESSOR_ARCHITECTURE").Equals(
+ "ARM", StringComparison.CurrentCultureIgnoreCase))
+ {
+ isProcessorArm = true;
+ }
+#else
+ if (Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE").Equals(
+ "ARM", StringComparison.CurrentCultureIgnoreCase))
+ {
+ isProcessorArm = true;
+ }
+#endif
+
+ x = 0;
+ y = 0;
+ z = Math.Pow(x, y);
+ if (z != 1)
+ {
+ Console.WriteLine("x: {0}, y: {1}, Pow(x,y): {2}", x, y, z);
+ pass = false;
+ }
+
+ x = Double.MinValue;
+ y = 1.0;
+ z = Math.Pow(x, y);
+ if (z != Double.MinValue)
+ {
+ Console.WriteLine("x: {0}, y: {1}, Pow(x,y): {2}", x, y, z);
+ pass = false;
+ }
+
+ if (isProcessorArm)
+ {
+ //Skip this Test due to the way how Double.Epsilon is defined on ARM
+ Console.WriteLine("Skipping Pow(Double.Epsilon,1) test on ARM");
+ }
+ else
+ {
+ x = Double.Epsilon;
+ y = 1.0;
+ z = Math.Pow(x, y);
+ if (z != Double.Epsilon)
+ {
+ Console.WriteLine("x: {0}, y: {1}, Pow(x,y): {2}", x, y, z);
+ pass = false;
+ }
+ }
+
+ x = Double.MaxValue;
+ y = 1.0;
+ z = Math.Pow(x, y);
+ if (z != Double.MaxValue)
+ {
+ Console.WriteLine("x: {0}, y: {1}, Pow(x,y): {2}", x, y, z);
+ pass = false;
+ }
+
+ x = Double.NegativeInfinity;
+ y = 1;
+ z = Math.Pow(x, y);
+ if (z != Double.NegativeInfinity)
+ {
+ Console.WriteLine("x: {0}, y: {1}, Pow(x,y): {2}", x, y, z);
+ pass = false;
+ }
+
+ x = Double.NaN;
+ y = 1;
+ z = Math.Pow(x, y);
+ if (!Double.IsNaN(z))
+ {
+ Console.WriteLine("x: {0}, y: {1}, Pow(x,y): {2}", x, y, z);
+ pass = false;
+ }
+
+ x = Double.PositiveInfinity;
+ y = 1;
+ z = Math.Pow(x, y);
+ if (z != Double.PositiveInfinity)
+ {
+ Console.WriteLine("x: {0}, y: {1}, Pow(x,y): {2}", x, y, z);
+ pass = false;
+ }
+
+ x = 1;
+ y = Double.MinValue;
+ z = Math.Pow(x, y);
+ if (z != 1)
+ {
+ Console.WriteLine("x: {0}, y: {1}, Pow(x,y): {2}", x, y, z);
+ pass = false;
+ }
+
+ x = 1;
+ y = Double.MaxValue;
+ z = Math.Pow(x, y);
+ if (z != 1)
+ {
+ Console.WriteLine("x: {0}, y: {1}, Pow(x,y): {2}", x, y, z);
+ pass = false;
+ }
+
+ x = 1.0;
+ y = Double.Epsilon;
+ z = Math.Pow(x, y);
+ if (z != 1)
+ {
+ Console.WriteLine("x: {0}, y: {1}, Pow(x,y): {2}", x, y, z);
+ pass = false;
+ }
+
+ x = 1;
+ y = Double.NaN;
+ z = Math.Pow(x, y);
+ if (!Double.IsNaN(z))
+ {
+ Console.WriteLine("x: {0}, y: {1}, Pow(x,y): {2}", x, y, z);
+ pass = false;
+ }
+
+ if (pass)
+ {
+ Console.WriteLine("PASSED");
+ return 100;
+ }
+ else
+ {
+ Console.WriteLine("FAILED");
+ return 1;
+ }
+ }
+}
diff --git a/tests/src/JIT/Directed/intrinsic/pow/pow2.cs b/tests/src/JIT/Directed/intrinsic/pow/pow2.cs
new file mode 100644
index 0000000000..1d0344c52f
--- /dev/null
+++ b/tests/src/JIT/Directed/intrinsic/pow/pow2.cs
@@ -0,0 +1,173 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+//
+
+//testing plain double, array member, struct member or class member
+
+using System;
+
+internal struct vt
+{
+ public double[,] x;
+}
+
+internal class cl
+{
+ public double[,,] x;
+ public cl()
+ {
+ x = new double[6, 5, 4];
+ }
+}
+internal class pow2
+{
+ public static double CalculateSinh(double x)
+ {
+ double a = Math.Pow(Math.E, x);
+ double b = Math.Pow(Math.E, -x);
+ return (a - b) / 2;
+ }
+
+ public static double CalculateSinh(double[] x)
+ {
+ double a = Math.Pow(Math.E, x[1]);
+ double b = Math.Pow(Math.E, -x[1]);
+ return (a - b) / 2;
+ }
+
+ public static double CalculateSinh(double[,] x)
+ {
+ double a = Math.Pow(Math.E, x[1, 1]);
+ double b = Math.Pow(Math.E, -x[1, 1]);
+ return (a - b) / 2;
+ }
+
+ public static double CalculateSinh(double[,,] x)
+ {
+ double a = Math.Pow(Math.E, x[2, 1, 1]);
+ double b = Math.Pow(Math.E, -x[2, 1, 1]);
+ return (a - b) / 2;
+ }
+
+ public static double CalculateSinh(double[][,] x)
+ {
+ double a = Math.Pow(Math.E, x[2][1, 1]);
+ double b = Math.Pow(Math.E, -x[2][1, 1]);
+ return (a - b) / 2;
+ }
+
+ public static double CalculateSinh(vt vt1)
+ {
+ double a = Math.Pow(Math.E, vt1.x[1, 1]);
+ double b = Math.Pow(Math.E, -vt1.x[1, 1]);
+ return (a - b) / 2;
+ }
+
+ public static double CalculateSinh(cl cl1)
+ {
+ double a = Math.Pow(Math.E, cl1.x[5, 1, 3]);
+ double b = Math.Pow(Math.E, -cl1.x[5, 1, 3]);
+ return (a - b) / 2;
+ }
+
+ public static int Main()
+ {
+ bool pass = true;
+
+ double x, y, z;
+
+ //Instead of using 10 * Double.Epsilon as the maximum allowed Delta
+ //we can use a small value based on the precision of double (15-16 digits)
+ //to accomodate slight differences in the pow intrinsic on ARM
+ double maxDelta = 9.9E-16;
+
+ //straight
+ x = 1.2;
+ y = Math.Sinh(x);
+ z = CalculateSinh(x);
+ if ((y - z) > maxDelta)
+ {
+ Console.WriteLine("x: {0}, Sinh(x): {1}, (Pow(E,x)-Pow(E,-x))/2: {2}", x, y, z);
+ pass = false;
+ }
+
+ //array 1d
+ double[] arr1d = new double[3];
+ for (int i = 0; i < 3; i++)
+ arr1d[i] = i + 0.2;
+ z = CalculateSinh(arr1d);
+ if ((y - z) > maxDelta)
+ {
+ Console.WriteLine("x: {0}, Sinh(x): {1}, (Pow(E,x)-Pow(E,-x))/2: {2}", x, y, z);
+ pass = false;
+ }
+
+ //array 2d
+ double[,] arr2d = new double[3, 2];
+ for (int i = 0; i < 3; i++)
+ arr2d[i, 1] = i + 0.2;
+ z = CalculateSinh(arr2d);
+ if ((y - z) > maxDelta)
+ {
+ Console.WriteLine("x: {0}, Sinh(x): {1}, (Pow(E,x)-Pow(E,-x))/2: {2}", x, y, z);
+ pass = false;
+ }
+
+ //array 3d
+ double[,,] arr3d = new double[3, 4, 2];
+ for (int i = 0; i < 3; i++)
+ arr3d[2, i, 1] = i + 0.2;
+ z = CalculateSinh(arr3d);
+ if ((y - z) > maxDelta)
+ {
+ Console.WriteLine("x: {0}, Sinh(x): {1}, (Pow(E,x)-Pow(E,-x))/2: {2}", x, y, z);
+ pass = false;
+ }
+
+ //jagged array
+ double[][,] jaggedarr = new double[3][,];
+ jaggedarr[2] = new double[4, 3];
+ for (int i = 0; i < 3; i++)
+ jaggedarr[2][i, 1] = i + 0.2;
+ z = CalculateSinh(jaggedarr);
+ if ((y - z) > maxDelta)
+ {
+ Console.WriteLine("x: {0}, Sinh(x): {1}, (Pow(E,x)-Pow(E,-x))/2: {2}", x, y, z);
+ pass = false;
+ }
+
+ //struct
+ vt vt1;
+ vt1.x = new double[4, 5];
+ for (int i = 0; i < 3; i++)
+ vt1.x[i, 1] = i + 0.2;
+ z = CalculateSinh(vt1);
+ if ((y - z) > maxDelta)
+ {
+ Console.WriteLine("x: {0}, Sinh(x): {1}, (Pow(E,x)-Pow(E,-x))/2: {2}", x, y, z);
+ pass = false;
+ }
+
+ //class
+ cl cl1 = new cl();
+ for (int i = 0; i < 3; i++)
+ cl1.x[5, i, 3] = i + 0.2;
+ z = CalculateSinh(cl1);
+ if ((y - z) > maxDelta)
+ {
+ Console.WriteLine("x: {0}, Sinh(x): {1}, (Pow(E,x)-Pow(E,-x))/2: {2}", x, y, z);
+ pass = false;
+ }
+
+ if (pass)
+ {
+ Console.WriteLine("PASSED");
+ return 100;
+ }
+ else
+ {
+ Console.WriteLine("FAILED");
+ return 1;
+ }
+ }
+}
diff --git a/tests/src/JIT/Directed/intrinsic/pow/pow3.cs b/tests/src/JIT/Directed/intrinsic/pow/pow3.cs
new file mode 100644
index 0000000000..42bc57f41a
--- /dev/null
+++ b/tests/src/JIT/Directed/intrinsic/pow/pow3.cs
@@ -0,0 +1,122 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+//
+
+//different data types, Int16, Int32, Int64, etc
+
+using System;
+
+internal class pow3
+{
+ public static int Main()
+ {
+ bool pass = true;
+
+ double a, b, y, z;
+
+ //Int16
+ Int16 x1 = 1;
+ y = Math.Sinh(x1);
+ a = Math.Pow(Math.E, x1);
+ b = Math.Pow(Math.E, -x1);
+ z = (a - b) / 2;
+ if ((y - z) > 10 * Double.Epsilon)
+ {
+ Console.WriteLine("x: {0}, Sinh(x): {1}, (Pow(E,x)-Pow(E,-x))/2: {2}", x1, y, z);
+ pass = false;
+ }
+
+ //Int32
+ Int32 x2 = 1;
+ y = Math.Sinh(x2);
+ a = Math.Pow(Math.E, x2);
+ b = Math.Pow(Math.E, -x2);
+ z = (a - b) / 2;
+ if ((y - z) > 10 * Double.Epsilon)
+ {
+ Console.WriteLine("x: {0}, Sinh(x): {1}, (Pow(E,x)-Pow(E,-x))/2: {2}", x2, y, z);
+ pass = false;
+ }
+
+ //Int64
+ Int64 x3 = 1;
+ y = Math.Sinh(x3);
+ a = Math.Pow(Math.E, x3);
+ b = Math.Pow(Math.E, -x3);
+ z = (a - b) / 2;
+ if ((y - z) > 10 * Double.Epsilon)
+ {
+ Console.WriteLine("x: {0}, Sinh(x): {1}, (Pow(E,x)-Pow(E,-x))/2: {2}", x3, y, z);
+ pass = false;
+ }
+
+ //UInt16
+ UInt16 ux1 = 1;
+ y = Math.Sinh(x1);
+ a = Math.Pow(Math.E, ux1);
+ b = Math.Pow(Math.E, -ux1);
+ z = (a - b) / 2;
+ if ((y - z) > 10 * Double.Epsilon)
+ {
+ Console.WriteLine("x: {0}, Sinh(x): {1}, (Pow(E,x)-Pow(E,-x))/2: {2}", x1, y, z);
+ pass = false;
+ }
+
+ //UInt32
+ UInt32 ux2 = 1;
+ y = Math.Sinh(ux2);
+ a = Math.Pow(Math.E, ux2);
+ b = Math.Pow(Math.E, -ux2);
+ z = (a - b) / 2;
+ if ((y - z) > 10 * Double.Epsilon)
+ {
+ Console.WriteLine("x: {0}, Sinh(x): {1}, (Pow(E,x)-Pow(E,-x))/2: {2}", x2, y, z);
+ pass = false;
+ }
+
+ //UInt64
+ UInt64 ux3 = 1;
+ y = Math.Sinh(ux3);
+ a = Math.Pow(Math.E, ux3);
+ b = 1 / a;
+ z = (a - b) / 2;
+ if ((y - z) > 10 * Double.Epsilon)
+ {
+ Console.WriteLine("x: {0}, Sinh(x): {1}, (Pow(E,x)-Pow(E,-x))/2: {2}", x3, y, z);
+ pass = false;
+ }
+
+ Single x4 = 1;
+ y = Math.Sinh(x4);
+ a = Math.Pow(Math.E, x4);
+ b = Math.Pow(Math.E, -x4);
+ z = (a - b) / 2;
+ if ((y - z) > 10 * Double.Epsilon)
+ {
+ Console.WriteLine("x: {0}, Sinh(x): {1}, (Pow(E,x)-Pow(E,-x))/2: {2}", x3, y, z);
+ pass = false;
+ }
+
+ Decimal x5 = 1;
+ y = Math.Sinh(Decimal.ToDouble(x5));
+ a = Math.Pow(Math.E, Decimal.ToDouble(x5));
+ b = Math.Pow(Math.E, -Decimal.ToDouble(x5));
+ z = (a - b) / 2;
+ if ((y - z) > 10 * Double.Epsilon)
+ {
+ Console.WriteLine("x: {0}, Sinh(x): {1}, (Pow(E,x)-Pow(E,-x))/2: {2}", x3, y, z);
+ pass = false;
+ }
+
+ if (pass)
+ {
+ Console.WriteLine("PASSED");
+ return 100;
+ }
+ else
+ {
+ Console.WriteLine("FAILED");
+ return 1;
+ }
+ }
+}
diff --git a/tests/src/JIT/Directed/lifetime/app.config b/tests/src/JIT/Directed/lifetime/app.config
new file mode 100644
index 0000000000..62803f5972
--- /dev/null
+++ b/tests/src/JIT/Directed/lifetime/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> \ No newline at end of file
diff --git a/tests/src/JIT/Directed/lifetime/cs_template.proj b/tests/src/JIT/Directed/lifetime/cs_template.proj
new file mode 100644
index 0000000000..adc2f21e14
--- /dev/null
+++ b/tests/src/JIT/Directed/lifetime/cs_template.proj
@@ -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>
diff --git a/tests/src/JIT/Directed/lifetime/lifetime.csproj b/tests/src/JIT/Directed/lifetime/lifetime.csproj
new file mode 100644
index 0000000000..33b2928ebc
--- /dev/null
+++ b/tests/src/JIT/Directed/lifetime/lifetime.csproj
@@ -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>
diff --git a/tests/src/JIT/Directed/lifetime/lifetime1.cs b/tests/src/JIT/Directed/lifetime/lifetime1.cs
new file mode 100644
index 0000000000..46d428098d
--- /dev/null
+++ b/tests/src/JIT/Directed/lifetime/lifetime1.cs
@@ -0,0 +1,159 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+//
+
+// testing the JIT handling and GC reporting of "liveness" of GC variable
+
+using System;
+
+internal class Test
+{
+ private class A
+ {
+ public A()
+ {
+ Console.WriteLine("A");
+ _iMember = 123;
+ Test.aExists = true;
+ }
+ ~A()
+ {
+ Console.WriteLine("~A");
+ Test.aExists = false;
+ }
+ public bool F()
+ {
+ Console.WriteLine("A.F(): iMember = {0}", _iMember);
+ return true;
+ }
+ private volatile int _iMember;
+ }
+
+ public static volatile bool aExists = false;
+
+ public static int f1()
+ {
+ A a = new A();
+ a.F();
+
+ // Testcase 1
+ Console.WriteLine();
+ Console.WriteLine("Testcase 1");
+ if (!Test.aExists)
+ {
+ Console.WriteLine("Testcase 1 FAILED");
+ return -1;
+ }
+ a.F();
+ a = null;
+ return 100;
+ }
+
+ public static int f2()
+ {
+ A a = new A();
+ a.F();
+ a = null;
+
+ // Testcase 3
+ Console.WriteLine();
+ Console.WriteLine("Testcase 3");
+ if (!Test.aExists)
+ {
+ Console.WriteLine("Testcase 3 FAILED");
+ return -1;
+ }
+ return 100;
+ }
+
+
+ public static int f3()
+ {
+ A a = new A();
+ a.F();
+ a = null;
+ GC.Collect();
+ GC.WaitForPendingFinalizers();
+
+ A b = new A();
+ a = b;
+ GC.Collect();
+ GC.WaitForPendingFinalizers();
+ Console.WriteLine();
+ Console.WriteLine("Testcase 5");
+ if (!Test.aExists)
+ {
+ Console.WriteLine("Testcase 5 FAILED");
+ return -1;
+ }
+ GC.KeepAlive(b);
+ // Testcase 6
+ Console.WriteLine();
+ Console.WriteLine("Testcase 6");
+ if (b == null)
+ {
+ Console.WriteLine("Testcase 6 FAILED");
+ return -1;
+ }
+
+ b = null;
+
+ return 100;
+ }
+
+
+ private static int Main()
+ {
+ if (f1() != 100) return -1;
+ CleanGC();
+
+ // Testcase 2
+ Console.WriteLine();
+ Console.WriteLine("Testcase 2");
+ // here JIT should know a is not live anymore
+ if (Test.aExists)
+ {
+ Console.WriteLine("Testcase 2 FAILED");
+ return -1;
+ }
+
+ if (f2() != 100) return -1;
+ CleanGC();
+
+ // here JIT should know object a is not live anymore
+ // Testcase 4
+ Console.WriteLine();
+ Console.WriteLine("Testcase 4");
+ if (Test.aExists)
+ {
+ Console.WriteLine("Testcase 4 FAILED");
+ return -1;
+ }
+
+ if (f3() != 100) return -1;
+ CleanGC();
+
+ // here JIT should know object a is not live anymore
+ // Testcase 7
+ Console.WriteLine();
+ Console.WriteLine("Testcase 7");
+ if (Test.aExists)
+ {
+ Console.WriteLine("Testcase 7 FAILED");
+ return -1;
+ }
+
+ CleanGC();
+
+
+
+ Console.WriteLine("Test SUCCESS");
+ return 100;
+ }
+
+ private static void CleanGC()
+ {
+ GC.Collect();
+ GC.WaitForPendingFinalizers();
+ }
+}
diff --git a/tests/src/JIT/Directed/lifetime/lifetime2.cs b/tests/src/JIT/Directed/lifetime/lifetime2.cs
new file mode 100644
index 0000000000..e6d5685893
--- /dev/null
+++ b/tests/src/JIT/Directed/lifetime/lifetime2.cs
@@ -0,0 +1,210 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+//
+
+// Testing JIT handling and GC reporting of liveness of GC variable
+
+using System;
+using System.Collections.Generic;
+
+internal class Test
+{
+ public static int aExists;
+ public static int bExists;
+ private abstract class A
+ {
+ }
+ private class B : A
+ {
+ public B()
+ {
+ aExists++;
+ }
+ ~B()
+ {
+ aExists--;
+ Console.WriteLine("~B");
+ }
+
+ public void F()
+ {
+ Console.WriteLine("B.F");
+ }
+ }
+ private class C : B
+ {
+ public C()
+ {
+ bExists++;
+ }
+ ~C()
+ {
+ bExists--;
+ Console.WriteLine("~C");
+ }
+
+ public void G()
+ {
+ Console.WriteLine("C.G");
+ }
+ }
+ private static int f1()
+ {
+ B a = new B();
+ a.F();
+
+ Console.WriteLine();
+ Console.WriteLine("testcase f1-1");
+ if (aExists != 1)
+ {
+ Console.WriteLine("f1-1 failed");
+ return -1;
+ }
+
+ GC.KeepAlive(a);
+ a = null;
+ GC.Collect();
+ GC.WaitForPendingFinalizers();
+
+ Console.WriteLine();
+ Console.WriteLine("testcase f1-2");
+ if (aExists != 0)
+ {
+ Console.WriteLine("f1-2 failed");
+ return -1;
+ }
+
+ C b = new C();
+ b.G();
+
+ Console.WriteLine();
+ Console.WriteLine("testcase f1-3");
+ if ((aExists != 1) || (bExists != 1))
+ {
+ Console.WriteLine("f1-3 failed");
+ return -1;
+ }
+
+ GC.KeepAlive(b);
+ b = null;
+ GC.Collect();
+ GC.WaitForPendingFinalizers();
+
+ Console.WriteLine();
+ Console.WriteLine("testcase f1-4");
+ if ((aExists != 0) || (bExists != 0))
+ {
+ Console.WriteLine("f1-4 failed");
+ return -1;
+ }
+ return 100;
+ }
+ private static int f2()
+ {
+ B a = new B();
+ {
+ C b = new C();
+ b.G();
+ b = null;
+ }
+ GC.Collect();
+ GC.WaitForPendingFinalizers();
+
+ a.F();
+ Console.WriteLine();
+ Console.WriteLine("testcase f2-1");
+ if ((aExists != 1) || (bExists != 0))
+ {
+ Console.WriteLine("f2-1 failed");
+ return -1;
+ }
+
+ GC.KeepAlive(a);
+ a = null;
+ GC.Collect();
+ GC.WaitForPendingFinalizers();
+ Console.WriteLine();
+ Console.WriteLine("testcase f2-2");
+ if (aExists != 0)
+ {
+ Console.WriteLine("f2-2 failed");
+ return -1;
+ }
+ return 100;
+ }
+ private static int f3()
+ {
+ C b = new C();
+ b = null;
+ GC.Collect();
+ GC.WaitForPendingFinalizers();
+ Console.WriteLine();
+ Console.WriteLine("testcase f3");
+ if (aExists != 0)
+ {
+ Console.WriteLine("f3 failed");
+ return -1;
+ }
+ b = null;
+ return 100;
+ }
+ private static int f4()
+ {
+ B a = new B();
+ a.F();
+ C b = new C();
+ b.G();
+
+ Console.WriteLine();
+ Console.WriteLine("testcase f4");
+ if ((aExists != 2) || (bExists != 1))
+ {
+ Console.WriteLine("f4 failed");
+ return -1;
+ }
+
+ GC.KeepAlive(a);
+ GC.KeepAlive(b);
+ return 100;
+ }
+
+ private static int f5()
+ {
+ Console.WriteLine();
+ Console.WriteLine("testcase f5");
+ if ((aExists != 0) || (bExists != 0))
+ {
+ Console.WriteLine("f5 failed");
+ return -1;
+ }
+ return 100;
+ }
+
+ private static int Main()
+ {
+ if (f1() != 100)
+ return -1;
+ CleanGC();
+ if (f2() != 100)
+ return -1;
+ CleanGC();
+ if (f3() != 100)
+ return -1;
+ CleanGC();
+ if (f4() != 100)
+ return -1;
+ CleanGC();
+ if (f5() != 100)
+ return -1;
+ CleanGC();
+
+ Console.WriteLine("PASSED");
+ return 100;
+ }
+
+ private static void CleanGC()
+ {
+ GC.Collect();
+ GC.WaitForPendingFinalizers();
+ }
+}
diff --git a/tests/src/JIT/Directed/lifetime/packages.config b/tests/src/JIT/Directed/lifetime/packages.config
new file mode 100644
index 0000000000..06d3d11ead
--- /dev/null
+++ b/tests/src/JIT/Directed/lifetime/packages.config
@@ -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>
diff --git a/tests/src/JIT/Directed/localloc/app.config b/tests/src/JIT/Directed/localloc/app.config
new file mode 100644
index 0000000000..62803f5972
--- /dev/null
+++ b/tests/src/JIT/Directed/localloc/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> \ No newline at end of file
diff --git a/tests/src/JIT/Directed/localloc/cs_template.proj b/tests/src/JIT/Directed/localloc/cs_template.proj
new file mode 100644
index 0000000000..adc2f21e14
--- /dev/null
+++ b/tests/src/JIT/Directed/localloc/cs_template.proj
@@ -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>
diff --git a/tests/src/JIT/Directed/localloc/localloc.csproj b/tests/src/JIT/Directed/localloc/localloc.csproj
new file mode 100644
index 0000000000..33b2928ebc
--- /dev/null
+++ b/tests/src/JIT/Directed/localloc/localloc.csproj
@@ -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>
diff --git a/tests/src/JIT/Directed/localloc/localloc3.cs b/tests/src/JIT/Directed/localloc/localloc3.cs
new file mode 100644
index 0000000000..e08f5aa6ca
--- /dev/null
+++ b/tests/src/JIT/Directed/localloc/localloc3.cs
@@ -0,0 +1,88 @@
+// 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 unsafe class test1
+{
+ static public int f(int i)
+ {
+ byte* p = stackalloc byte[i];
+ p[0] = 4;
+ return p[0];
+ }
+
+ static public void f0()
+ {
+ while (true)
+ {
+ char* p = stackalloc char[10];
+ }
+ }
+
+ static public void f1()
+ {
+ char* p = stackalloc char[1000000];
+ }
+
+ unsafe public static int Main()
+ {
+ bool pass = true;
+
+ //testcase 1:
+ try
+ {
+ char* p = stackalloc char[0];
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine("testcase 1: should not be here");
+ Console.WriteLine(e.Message);
+ pass = false;
+ }
+
+ if (!pass)
+ goto output;
+
+ //testcase 2:
+ try
+ {
+ char* p = stackalloc char[100];
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine("testcase 1: should not be here");
+ Console.WriteLine(e.Message);
+ pass = false;
+ }
+
+ if (!pass)
+ goto output;
+
+ //testcase 3:
+ try
+ {
+ Console.Write("stackalloc(10)...");
+ f(10);
+ Console.WriteLine("done");
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine("Exception occurred: {0}", e.Message);
+ pass = false;
+ }
+
+ output:
+ if (pass)
+ {
+ Console.WriteLine("PASSED");
+ return 100;
+ }
+ else
+ {
+ Console.WriteLine("FAILED");
+ return 1;
+ }
+ }
+}
diff --git a/tests/src/JIT/Directed/localloc/packages.config b/tests/src/JIT/Directed/localloc/packages.config
new file mode 100644
index 0000000000..06d3d11ead
--- /dev/null
+++ b/tests/src/JIT/Directed/localloc/packages.config
@@ -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>
diff --git a/tests/src/JIT/Directed/newarr/app.config b/tests/src/JIT/Directed/newarr/app.config
new file mode 100644
index 0000000000..62803f5972
--- /dev/null
+++ b/tests/src/JIT/Directed/newarr/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> \ No newline at end of file
diff --git a/tests/src/JIT/Directed/newarr/cs_template.proj b/tests/src/JIT/Directed/newarr/cs_template.proj
new file mode 100644
index 0000000000..adc2f21e14
--- /dev/null
+++ b/tests/src/JIT/Directed/newarr/cs_template.proj
@@ -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>
diff --git a/tests/src/JIT/Directed/newarr/newarr.cs b/tests/src/JIT/Directed/newarr/newarr.cs
new file mode 100644
index 0000000000..acbd24ef69
--- /dev/null
+++ b/tests/src/JIT/Directed/newarr/newarr.cs
@@ -0,0 +1,100 @@
+// 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 AA
+{
+ private static int Main()
+ {
+ uint SMALL1 = 0x00000100;
+ uint SMALL2 = 0x7fffffff;
+ uint BIG1 = 0x80000000;
+ uint BIG2 = 0xffffffff;
+ int[] array = null;
+ AA[,,] marray = null;
+ try
+ {
+ array = new int[SMALL1];
+ Console.WriteLine("Test 1 passed");
+ }
+ catch (Exception)
+ {
+ Console.WriteLine("Test 1 failed");
+ return 101;
+ }
+ try
+ {
+ array = new int[SMALL2];
+ Console.WriteLine("Test 2 failed");
+ return 102;
+ }
+ catch (OutOfMemoryException)
+ {
+ Console.WriteLine("Test 2 passed");
+ }
+ try
+ {
+ array = new int[BIG1];
+ Console.WriteLine("Test 3 failed");
+ return 103;
+ }
+ catch (OverflowException)
+ {
+ Console.WriteLine("Test 3 passed");
+ }
+ try
+ {
+ array = new int[BIG2];
+ Console.WriteLine("Test 4 failed");
+ return 104;
+ }
+ catch (OverflowException)
+ {
+ Console.WriteLine("Test 4 passed");
+ }
+ try
+ {
+ marray = new AA[SMALL1, 1, SMALL1];
+ Console.WriteLine("Test 5 passed");
+ }
+ catch (Exception)
+ {
+ Console.WriteLine("Test 5 failed");
+ return 105;
+ }
+ try
+ {
+ marray = new AA[2, SMALL2, SMALL2];
+ Console.WriteLine("Test 6 failed");
+ return 106;
+ }
+ catch (OutOfMemoryException)
+ {
+ Console.WriteLine("Test 6 passed");
+ }
+ try
+ {
+ marray = new AA[BIG1, BIG1, 2];
+ Console.WriteLine("Test 7 failed");
+ return 107;
+ }
+ catch (OverflowException)
+ {
+ Console.WriteLine("Test 7 passed");
+ }
+ try
+ {
+ marray = new AA[BIG2, 0, 1];
+ Console.WriteLine("Test 8 failed");
+ return 108;
+ }
+ catch (OverflowException)
+ {
+ Console.WriteLine("Test 8 passed");
+ }
+ Console.WriteLine("All tests passed");
+ return 100;
+ }
+}
diff --git a/tests/src/JIT/Directed/newarr/newarr.csproj b/tests/src/JIT/Directed/newarr/newarr.csproj
new file mode 100644
index 0000000000..33b2928ebc
--- /dev/null
+++ b/tests/src/JIT/Directed/newarr/newarr.csproj
@@ -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>
diff --git a/tests/src/JIT/Directed/newarr/packages.config b/tests/src/JIT/Directed/newarr/packages.config
new file mode 100644
index 0000000000..06d3d11ead
--- /dev/null
+++ b/tests/src/JIT/Directed/newarr/packages.config
@@ -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>
diff --git a/tests/src/JIT/Directed/shift/app.config b/tests/src/JIT/Directed/shift/app.config
new file mode 100644
index 0000000000..62803f5972
--- /dev/null
+++ b/tests/src/JIT/Directed/shift/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> \ No newline at end of file
diff --git a/tests/src/JIT/Directed/shift/cs_template.proj b/tests/src/JIT/Directed/shift/cs_template.proj
new file mode 100644
index 0000000000..adc2f21e14
--- /dev/null
+++ b/tests/src/JIT/Directed/shift/cs_template.proj
@@ -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>
diff --git a/tests/src/JIT/Directed/shift/int16.cs b/tests/src/JIT/Directed/shift/int16.cs
new file mode 100644
index 0000000000..8390a628bb
--- /dev/null
+++ b/tests/src/JIT/Directed/shift/int16.cs
@@ -0,0 +1,155 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+//
+
+using System;
+
+namespace ShiftTest
+{
+ public class CL
+ {
+ public short clm_data = 0x7FFF;
+ }
+ public struct VT
+ {
+ public short vtm_data;
+ }
+ public class short32Test
+ {
+ private static short s_data = 0x7FFF;
+ public static short f1(short arg_data)
+ {
+ arg_data >>= 4;
+ return arg_data;
+ }
+ public static short f2(short arg_data)
+ {
+ arg_data <<= 4;
+ return arg_data;
+ }
+ public static int Main()
+ {
+ short loc_data = 0x7FFF;
+
+ short[] arr_data = new short[1];
+
+ CL cl = new CL();
+ VT vt;
+
+ s_data = 0x7FFF;
+ loc_data = 0x7FFF;
+ arr_data[0] = 0x7FFF;
+ cl.clm_data = 0x7FFF;
+ vt.vtm_data = 0x7FFF;
+
+ // Test >>
+
+ Console.WriteLine("The expected result of (0x7FFF>>4) is: {0}", (0x7FFF >> 4));
+ Console.WriteLine();
+
+ Console.WriteLine("The actual result for funciton argument is: {0}", f1(0x7FFF));
+ loc_data >>= 4;
+ Console.WriteLine("The actual result for local variable is: {0}", loc_data);
+ s_data >>= 4;
+ Console.WriteLine("The actual result for static field is: {0}", s_data);
+ arr_data[0] >>= 4;
+ Console.WriteLine("The actual result for array element is: {0}", arr_data[0]);
+ cl.clm_data >>= 4;
+ Console.WriteLine("The actual result for class member is: {0}", cl.clm_data);
+ vt.vtm_data >>= 4;
+ Console.WriteLine("The actual result for valuestruct member is: {0}", vt.vtm_data);
+
+ Console.WriteLine();
+
+ if (loc_data != (0x7FFF >> 4))
+ {
+ Console.WriteLine("FAILED for local variable");
+ return -1;
+ }
+ if (f1(0x7FFF) != (0x7FFF >> 4))
+ {
+ Console.WriteLine("FAILED for function argument");
+ return -1;
+ }
+ if (s_data != (0x7FFF >> 4))
+ {
+ Console.WriteLine("FAILED for static field");
+ return -1;
+ }
+ if (arr_data[0] != (0x7FFF >> 4))
+ {
+ Console.WriteLine("FAILED for array element");
+ return -1;
+ }
+ if (cl.clm_data != (0x7FFF >> 4))
+ {
+ Console.WriteLine("FAILED for class member");
+ return -1;
+ }
+ if (vt.vtm_data != (0x7FFF >> 4))
+ {
+ Console.WriteLine("FAILED for valuestruct member");
+ return -1;
+ }
+
+ // Test <<
+
+ s_data = 0x1;
+ loc_data = 0x1;
+ arr_data[0] = 0x1;
+ cl.clm_data = 0x1;
+ vt.vtm_data = 0x1;
+
+ Console.WriteLine("The expected result of (0x1<<4) is: {0}", ((short)0x1 << 4));
+ Console.WriteLine();
+
+ Console.WriteLine("The actual result for funciton argument is: {0}", f2(0x1));
+ loc_data <<= 4;
+ Console.WriteLine("The actual result for local variable is: {0}", loc_data);
+ s_data <<= 4;
+ Console.WriteLine("The actual result for static field is: {0}", s_data);
+ arr_data[0] <<= 4;
+ Console.WriteLine("The actual result for array element is: {0}", arr_data[0]);
+ cl.clm_data <<= 4;
+ Console.WriteLine("The actual result for class member is: {0}", cl.clm_data);
+ vt.vtm_data <<= 4;
+ Console.WriteLine("The actual result for valuestruct member is: {0}", vt.vtm_data);
+
+ Console.WriteLine();
+
+ if (loc_data != (0x1 << 4))
+ {
+ Console.WriteLine("FAILED for local variable");
+ return -1;
+ }
+ if (f2(0x1) != (0x1 << 4))
+ {
+ Console.WriteLine("FAILED for function argument");
+ return -1;
+ }
+ if (s_data != (0x1 << 4))
+ {
+ Console.WriteLine("FAILED for static field");
+ return -1;
+ }
+ if (arr_data[0] != (0x1 << 4))
+ {
+ Console.WriteLine("FAILED for array element");
+ return -1;
+ }
+ if (cl.clm_data != (0x1 << 4))
+ {
+ Console.WriteLine("FAILED for class member");
+ return -1;
+ }
+ if (vt.vtm_data != (0x1 << 4))
+ {
+ Console.WriteLine("FAILED for valuestruct member");
+ return -1;
+ }
+
+ Console.WriteLine("PASSED");
+ return 100;
+ }
+ }
+}
diff --git a/tests/src/JIT/Directed/shift/int32.cs b/tests/src/JIT/Directed/shift/int32.cs
new file mode 100644
index 0000000000..23320ba0ee
--- /dev/null
+++ b/tests/src/JIT/Directed/shift/int32.cs
@@ -0,0 +1,155 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+//
+
+using System;
+
+namespace ShiftTest
+{
+ public class CL
+ {
+ public int clm_data = 0x7FFFFFFF;
+ }
+ public struct VT
+ {
+ public int vtm_data;
+ }
+ public class int32Test
+ {
+ private static int s_data = 0x7FFFFFFF;
+ public static int f1(int arg_data)
+ {
+ arg_data >>= 4;
+ return arg_data;
+ }
+ public static int f2(int arg_data)
+ {
+ arg_data <<= 4;
+ return arg_data;
+ }
+ public static int Main()
+ {
+ int loc_data = 0x7FFFFFFF;
+
+ int[] arr_data = new int[1];
+
+ CL cl = new CL();
+ VT vt;
+
+ s_data = 0x7FFFFFFF;
+ loc_data = 0x7FFFFFFF;
+ arr_data[0] = 0x7FFFFFFF;
+ cl.clm_data = 0x7FFFFFFF;
+ vt.vtm_data = 0x7FFFFFFF;
+
+ // Test >>
+
+ Console.WriteLine("The expected result of (0x7FFFFFFF>>4) is: {0}", (0x7FFFFFFF >> 4));
+ Console.WriteLine();
+
+ Console.WriteLine("The actual result for funciton argument is: {0}", f1(0x7FFFFFFF));
+ loc_data >>= 4;
+ Console.WriteLine("The actual result for local variable is: {0}", loc_data);
+ s_data >>= 4;
+ Console.WriteLine("The actual result for static field is: {0}", s_data);
+ arr_data[0] >>= 4;
+ Console.WriteLine("The actual result for array element is: {0}", arr_data[0]);
+ cl.clm_data >>= 4;
+ Console.WriteLine("The actual result for class member is: {0}", cl.clm_data);
+ vt.vtm_data >>= 4;
+ Console.WriteLine("The actual result for valuestruct member is: {0}", vt.vtm_data);
+
+ Console.WriteLine();
+
+ if (loc_data != (0x7FFFFFFF >> 4))
+ {
+ Console.WriteLine("FAILED for local variable");
+ return -1;
+ }
+ if (f1(0x7FFFFFFF) != (0x7FFFFFFF >> 4))
+ {
+ Console.WriteLine("FAILED for function argument");
+ return -1;
+ }
+ if (s_data != (0x7FFFFFFF >> 4))
+ {
+ Console.WriteLine("FAILED for static field");
+ return -1;
+ }
+ if (arr_data[0] != (0x7FFFFFFF >> 4))
+ {
+ Console.WriteLine("FAILED for array element");
+ return -1;
+ }
+ if (cl.clm_data != (0x7FFFFFFF >> 4))
+ {
+ Console.WriteLine("FAILED for class member");
+ return -1;
+ }
+ if (vt.vtm_data != (0x7FFFFFFF >> 4))
+ {
+ Console.WriteLine("FAILED for valuestruct member");
+ return -1;
+ }
+
+ // Test <<
+
+ s_data = 0x1;
+ loc_data = 0x1;
+ arr_data[0] = 0x1;
+ cl.clm_data = 0x1;
+ vt.vtm_data = 0x1;
+
+ Console.WriteLine("The expected result of (0x1<<4) is: {0}", ((int)0x1 << 4));
+ Console.WriteLine();
+
+ Console.WriteLine("The actual result for funciton argument is: {0}", f2(0x1));
+ loc_data <<= 4;
+ Console.WriteLine("The actual result for local variable is: {0}", loc_data);
+ s_data <<= 4;
+ Console.WriteLine("The actual result for static field is: {0}", s_data);
+ arr_data[0] <<= 4;
+ Console.WriteLine("The actual result for array element is: {0}", arr_data[0]);
+ cl.clm_data <<= 4;
+ Console.WriteLine("The actual result for class member is: {0}", cl.clm_data);
+ vt.vtm_data <<= 4;
+ Console.WriteLine("The actual result for valuestruct member is: {0}", vt.vtm_data);
+
+ Console.WriteLine();
+
+ if (loc_data != (0x1 << 4))
+ {
+ Console.WriteLine("FAILED for local variable");
+ return -1;
+ }
+ if (f2(0x1) != (0x1 << 4))
+ {
+ Console.WriteLine("FAILED for function argument");
+ return -1;
+ }
+ if (s_data != (0x1 << 4))
+ {
+ Console.WriteLine("FAILED for static field");
+ return -1;
+ }
+ if (arr_data[0] != (0x1 << 4))
+ {
+ Console.WriteLine("FAILED for array element");
+ return -1;
+ }
+ if (cl.clm_data != (0x1 << 4))
+ {
+ Console.WriteLine("FAILED for class member");
+ return -1;
+ }
+ if (vt.vtm_data != (0x1 << 4))
+ {
+ Console.WriteLine("FAILED for valuestruct member");
+ return -1;
+ }
+
+ Console.WriteLine("PASSED");
+ return 100;
+ }
+ }
+}
diff --git a/tests/src/JIT/Directed/shift/int64.cs b/tests/src/JIT/Directed/shift/int64.cs
new file mode 100644
index 0000000000..e61b0d6e7d
--- /dev/null
+++ b/tests/src/JIT/Directed/shift/int64.cs
@@ -0,0 +1,155 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+//
+
+using System;
+
+namespace ShiftTest
+{
+ public class CL
+ {
+ public long clm_data = 0x7FFFFFFFFFFFFFFF;
+ }
+ public struct VT
+ {
+ public long vtm_data;
+ }
+ public class longTest
+ {
+ private static long s_data = 0x7FFFFFFFFFFFFFFF;
+ public static long f1(long arg_data)
+ {
+ arg_data >>= 8;
+ return arg_data;
+ }
+ public static long f2(long arg_data)
+ {
+ arg_data <<= 8;
+ return arg_data;
+ }
+ public static int Main()
+ {
+ long loc_data = 0x7FFFFFFFFFFFFFFF;
+
+ long[] arr_data = new long[1];
+
+ CL cl = new CL();
+ VT vt;
+
+ s_data = 0x7FFFFFFFFFFFFFFF;
+ loc_data = 0x7FFFFFFFFFFFFFFF;
+ arr_data[0] = 0x7FFFFFFFFFFFFFFF;
+ cl.clm_data = 0x7FFFFFFFFFFFFFFF;
+ vt.vtm_data = 0x7FFFFFFFFFFFFFFF;
+
+ // Test >>
+
+ Console.WriteLine("The expected result of (0x7FFFFFFFFFFFFFFF>>8) is: {0}", (0x7FFFFFFFFFFFFFFF >> 8));
+ Console.WriteLine();
+
+ Console.WriteLine("The actual result for funciton argument is: {0}", f1(0x7FFFFFFFFFFFFFFF));
+ loc_data >>= 8;
+ Console.WriteLine("The actual result for local variable is: {0}", loc_data);
+ s_data >>= 8;
+ Console.WriteLine("The actual result for static field is: {0}", s_data);
+ arr_data[0] >>= 8;
+ Console.WriteLine("The actual result for array element is: {0}", arr_data[0]);
+ cl.clm_data >>= 8;
+ Console.WriteLine("The actual result for class member is: {0}", cl.clm_data);
+ vt.vtm_data >>= 8;
+ Console.WriteLine("The actual result for valuestruct member is: {0}", vt.vtm_data);
+
+ Console.WriteLine();
+
+ if (loc_data != (0x7FFFFFFFFFFFFFFF >> 8))
+ {
+ Console.WriteLine("FAILED for local variable");
+ return -1;
+ }
+ if (f1(0x7FFFFFFFFFFFFFFF) != (0x7FFFFFFFFFFFFFFF >> 8))
+ {
+ Console.WriteLine("FAILED for function argument");
+ return -1;
+ }
+ if (s_data != (0x7FFFFFFFFFFFFFFF >> 8))
+ {
+ Console.WriteLine("FAILED for static field");
+ return -1;
+ }
+ if (arr_data[0] != (0x7FFFFFFFFFFFFFFF >> 8))
+ {
+ Console.WriteLine("FAILED for array element");
+ return -1;
+ }
+ if (cl.clm_data != (0x7FFFFFFFFFFFFFFF >> 8))
+ {
+ Console.WriteLine("FAILED for class member");
+ return -1;
+ }
+ if (vt.vtm_data != (0x7FFFFFFFFFFFFFFF >> 8))
+ {
+ Console.WriteLine("FAILED for valuestruct member");
+ return -1;
+ }
+
+ // Test <<
+
+ s_data = 0x1;
+ loc_data = 0x1;
+ arr_data[0] = 0x1;
+ cl.clm_data = 0x1;
+ vt.vtm_data = 0x1;
+
+ Console.WriteLine("The expected result of (0x1<<8) is: {0}", ((long)0x1 << 8));
+ Console.WriteLine();
+
+ Console.WriteLine("The actual result for funciton argument is: {0}", f2(0x1));
+ loc_data <<= 8;
+ Console.WriteLine("The actual result for local variable is: {0}", loc_data);
+ s_data <<= 8;
+ Console.WriteLine("The actual result for static field is: {0}", s_data);
+ arr_data[0] <<= 8;
+ Console.WriteLine("The actual result for array element is: {0}", arr_data[0]);
+ cl.clm_data <<= 8;
+ Console.WriteLine("The actual result for class member is: {0}", cl.clm_data);
+ vt.vtm_data <<= 8;
+ Console.WriteLine("The actual result for valuestruct member is: {0}", vt.vtm_data);
+
+ Console.WriteLine();
+
+ if (loc_data != (0x1 << 8))
+ {
+ Console.WriteLine("FAILED for local variable");
+ return -1;
+ }
+ if (f2(0x1) != (0x1 << 8))
+ {
+ Console.WriteLine("FAILED for function argument");
+ return -1;
+ }
+ if (s_data != (0x1 << 8))
+ {
+ Console.WriteLine("FAILED for static field");
+ return -1;
+ }
+ if (arr_data[0] != (0x1 << 8))
+ {
+ Console.WriteLine("FAILED for array element");
+ return -1;
+ }
+ if (cl.clm_data != (0x1 << 8))
+ {
+ Console.WriteLine("FAILED for class member");
+ return -1;
+ }
+ if (vt.vtm_data != (0x1 << 8))
+ {
+ Console.WriteLine("FAILED for valuestruct member");
+ return -1;
+ }
+
+ Console.WriteLine("PASSED");
+ return 100;
+ }
+ }
+}
diff --git a/tests/src/JIT/Directed/shift/packages.config b/tests/src/JIT/Directed/shift/packages.config
new file mode 100644
index 0000000000..06d3d11ead
--- /dev/null
+++ b/tests/src/JIT/Directed/shift/packages.config
@@ -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>
diff --git a/tests/src/JIT/Directed/shift/shift.csproj b/tests/src/JIT/Directed/shift/shift.csproj
new file mode 100644
index 0000000000..33b2928ebc
--- /dev/null
+++ b/tests/src/JIT/Directed/shift/shift.csproj
@@ -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>
diff --git a/tests/src/JIT/Directed/shift/uint16.cs b/tests/src/JIT/Directed/shift/uint16.cs
new file mode 100644
index 0000000000..0cfca46355
--- /dev/null
+++ b/tests/src/JIT/Directed/shift/uint16.cs
@@ -0,0 +1,155 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+//
+
+using System;
+
+namespace ShiftTest
+{
+ public class CL
+ {
+ public ushort clm_data = 0xFFFF;
+ }
+ public struct VT
+ {
+ public ushort vtm_data;
+ }
+ public class ushort32Test
+ {
+ private static ushort s_data = 0xFFFF;
+ public static ushort f1(ushort arg_data)
+ {
+ arg_data >>= 4;
+ return arg_data;
+ }
+ public static ushort f2(ushort arg_data)
+ {
+ arg_data <<= 4;
+ return arg_data;
+ }
+ public static int Main()
+ {
+ ushort loc_data = 0xFFFF;
+
+ ushort[] arr_data = new ushort[1];
+
+ CL cl = new CL();
+ VT vt;
+
+ s_data = 0xFFFF;
+ loc_data = 0xFFFF;
+ arr_data[0] = 0xFFFF;
+ cl.clm_data = 0xFFFF;
+ vt.vtm_data = 0xFFFF;
+
+ // Test >>
+
+ Console.WriteLine("The expected result of (0xFFFF>>4) is: {0}", (0xFFFF >> 4));
+ Console.WriteLine();
+
+ Console.WriteLine("The actual result for funciton argument is: {0}", f1(0xFFFF));
+ loc_data >>= 4;
+ Console.WriteLine("The actual result for local variable is: {0}", loc_data);
+ s_data >>= 4;
+ Console.WriteLine("The actual result for static field is: {0}", s_data);
+ arr_data[0] >>= 4;
+ Console.WriteLine("The actual result for array element is: {0}", arr_data[0]);
+ cl.clm_data >>= 4;
+ Console.WriteLine("The actual result for class member is: {0}", cl.clm_data);
+ vt.vtm_data >>= 4;
+ Console.WriteLine("The actual result for valuestruct member is: {0}", vt.vtm_data);
+
+ Console.WriteLine();
+
+ if (loc_data != (0xFFFF >> 4))
+ {
+ Console.WriteLine("FAILED for local variable");
+ return -1;
+ }
+ if (f1(0xFFFF) != (0xFFFF >> 4))
+ {
+ Console.WriteLine("FAILED for function argument");
+ return -1;
+ }
+ if (s_data != (0xFFFF >> 4))
+ {
+ Console.WriteLine("FAILED for static field");
+ return -1;
+ }
+ if (arr_data[0] != (0xFFFF >> 4))
+ {
+ Console.WriteLine("FAILED for array element");
+ return -1;
+ }
+ if (cl.clm_data != (0xFFFF >> 4))
+ {
+ Console.WriteLine("FAILED for class member");
+ return -1;
+ }
+ if (vt.vtm_data != (0xFFFF >> 4))
+ {
+ Console.WriteLine("FAILED for valuestruct member");
+ return -1;
+ }
+
+ // Test <<
+
+ s_data = 0x1;
+ loc_data = 0x1;
+ arr_data[0] = 0x1;
+ cl.clm_data = 0x1;
+ vt.vtm_data = 0x1;
+
+ Console.WriteLine("The expected result of (0x1<<4) is: {0}", ((ushort)0x1 << 4));
+ Console.WriteLine();
+
+ Console.WriteLine("The actual result for funciton argument is: {0}", f2(0x1));
+ loc_data <<= 4;
+ Console.WriteLine("The actual result for local variable is: {0}", loc_data);
+ s_data <<= 4;
+ Console.WriteLine("The actual result for static field is: {0}", s_data);
+ arr_data[0] <<= 4;
+ Console.WriteLine("The actual result for array element is: {0}", arr_data[0]);
+ cl.clm_data <<= 4;
+ Console.WriteLine("The actual result for class member is: {0}", cl.clm_data);
+ vt.vtm_data <<= 4;
+ Console.WriteLine("The actual result for valuestruct member is: {0}", vt.vtm_data);
+
+ Console.WriteLine();
+
+ if (loc_data != (0x1 << 4))
+ {
+ Console.WriteLine("FAILED for local variable");
+ return -1;
+ }
+ if (f2(0x1) != (0x1 << 4))
+ {
+ Console.WriteLine("FAILED for function argument");
+ return -1;
+ }
+ if (s_data != (0x1 << 4))
+ {
+ Console.WriteLine("FAILED for static field");
+ return -1;
+ }
+ if (arr_data[0] != (0x1 << 4))
+ {
+ Console.WriteLine("FAILED for array element");
+ return -1;
+ }
+ if (cl.clm_data != (0x1 << 4))
+ {
+ Console.WriteLine("FAILED for class member");
+ return -1;
+ }
+ if (vt.vtm_data != (0x1 << 4))
+ {
+ Console.WriteLine("FAILED for valuestruct member");
+ return -1;
+ }
+
+ Console.WriteLine("PASSED");
+ return 100;
+ }
+ }
+}
diff --git a/tests/src/JIT/Directed/shift/uint32.cs b/tests/src/JIT/Directed/shift/uint32.cs
new file mode 100644
index 0000000000..29e289e560
--- /dev/null
+++ b/tests/src/JIT/Directed/shift/uint32.cs
@@ -0,0 +1,155 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+//
+
+using System;
+
+namespace ShiftTest
+{
+ public class CL
+ {
+ public uint clm_data = 0xFFFFFFFF;
+ }
+ public struct VT
+ {
+ public uint vtm_data;
+ }
+ public class uint32Test
+ {
+ private static uint s_data = 0xFFFFFFFF;
+ public static uint f1(uint arg_data)
+ {
+ arg_data >>= 4;
+ return arg_data;
+ }
+ public static uint f2(uint arg_data)
+ {
+ arg_data <<= 4;
+ return arg_data;
+ }
+ public static int Main()
+ {
+ uint loc_data = 0xFFFFFFFF;
+
+ uint[] arr_data = new uint[1];
+
+ CL cl = new CL();
+ VT vt;
+
+ s_data = 0xFFFFFFFF;
+ loc_data = 0xFFFFFFFF;
+ arr_data[0] = 0xFFFFFFFF;
+ cl.clm_data = 0xFFFFFFFF;
+ vt.vtm_data = 0xFFFFFFFF;
+
+ // Test >>
+
+ Console.WriteLine("The expected result of (0xFFFFFFFF>>4) is: {0}", (0xFFFFFFFF >> 4));
+ Console.WriteLine();
+
+ Console.WriteLine("The actual result for funciton argument is: {0}", f1(0xFFFFFFFF));
+ loc_data >>= 4;
+ Console.WriteLine("The actual result for local variable is: {0}", loc_data);
+ s_data >>= 4;
+ Console.WriteLine("The actual result for static field is: {0}", s_data);
+ arr_data[0] >>= 4;
+ Console.WriteLine("The actual result for array element is: {0}", arr_data[0]);
+ cl.clm_data >>= 4;
+ Console.WriteLine("The actual result for class member is: {0}", cl.clm_data);
+ vt.vtm_data >>= 4;
+ Console.WriteLine("The actual result for valuestruct member is: {0}", vt.vtm_data);
+
+ Console.WriteLine();
+
+ if (loc_data != (0xFFFFFFFF >> 4))
+ {
+ Console.WriteLine("FAILED for local variable");
+ return -1;
+ }
+ if (f1(0xFFFFFFFF) != (0xFFFFFFFF >> 4))
+ {
+ Console.WriteLine("FAILED for function argument");
+ return -1;
+ }
+ if (s_data != (0xFFFFFFFF >> 4))
+ {
+ Console.WriteLine("FAILED for static field");
+ return -1;
+ }
+ if (arr_data[0] != (0xFFFFFFFF >> 4))
+ {
+ Console.WriteLine("FAILED for array element");
+ return -1;
+ }
+ if (cl.clm_data != (0xFFFFFFFF >> 4))
+ {
+ Console.WriteLine("FAILED for class member");
+ return -1;
+ }
+ if (vt.vtm_data != (0xFFFFFFFF >> 4))
+ {
+ Console.WriteLine("FAILED for valuestruct member");
+ return -1;
+ }
+
+ // Test <<
+
+ s_data = 0x1;
+ loc_data = 0x1;
+ arr_data[0] = 0x1;
+ cl.clm_data = 0x1;
+ vt.vtm_data = 0x1;
+
+ Console.WriteLine("The expected result of (0x1<<4) is: {0}", ((uint)0x1 << 4));
+ Console.WriteLine();
+
+ Console.WriteLine("The actual result for funciton argument is: {0}", f2(0x1));
+ loc_data <<= 4;
+ Console.WriteLine("The actual result for local variable is: {0}", loc_data);
+ s_data <<= 4;
+ Console.WriteLine("The actual result for static field is: {0}", s_data);
+ arr_data[0] <<= 4;
+ Console.WriteLine("The actual result for array element is: {0}", arr_data[0]);
+ cl.clm_data <<= 4;
+ Console.WriteLine("The actual result for class member is: {0}", cl.clm_data);
+ vt.vtm_data <<= 4;
+ Console.WriteLine("The actual result for valuestruct member is: {0}", vt.vtm_data);
+
+ Console.WriteLine();
+
+ if (loc_data != (0x1 << 4))
+ {
+ Console.WriteLine("FAILED for local variable");
+ return -1;
+ }
+ if (f2(0x1) != (0x1 << 4))
+ {
+ Console.WriteLine("FAILED for function argument");
+ return -1;
+ }
+ if (s_data != (0x1 << 4))
+ {
+ Console.WriteLine("FAILED for static field");
+ return -1;
+ }
+ if (arr_data[0] != (0x1 << 4))
+ {
+ Console.WriteLine("FAILED for array element");
+ return -1;
+ }
+ if (cl.clm_data != (0x1 << 4))
+ {
+ Console.WriteLine("FAILED for class member");
+ return -1;
+ }
+ if (vt.vtm_data != (0x1 << 4))
+ {
+ Console.WriteLine("FAILED for valuestruct member");
+ return -1;
+ }
+
+ Console.WriteLine("PASSED");
+ return 100;
+ }
+ }
+}
diff --git a/tests/src/JIT/Directed/shift/uint64.cs b/tests/src/JIT/Directed/shift/uint64.cs
new file mode 100644
index 0000000000..473dc225e5
--- /dev/null
+++ b/tests/src/JIT/Directed/shift/uint64.cs
@@ -0,0 +1,155 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+//
+
+using System;
+
+namespace ShiftTest
+{
+ public class CL
+ {
+ public ulong clm_data = 0xFFFFFFFFFFFFFFFF;
+ }
+ public struct VT
+ {
+ public ulong vtm_data;
+ }
+ public class ulong32Test
+ {
+ private static ulong s_data = 0xFFFFFFFFFFFFFFFF;
+ public static ulong f1(ulong arg_data)
+ {
+ arg_data >>= 8;
+ return arg_data;
+ }
+ public static ulong f2(ulong arg_data)
+ {
+ arg_data <<= 8;
+ return arg_data;
+ }
+ public static int Main()
+ {
+ ulong loc_data = 0xFFFFFFFFFFFFFFFF;
+
+ ulong[] arr_data = new ulong[1];
+
+ CL cl = new CL();
+ VT vt;
+
+ s_data = 0xFFFFFFFFFFFFFFFF;
+ loc_data = 0xFFFFFFFFFFFFFFFF;
+ arr_data[0] = 0xFFFFFFFFFFFFFFFF;
+ cl.clm_data = 0xFFFFFFFFFFFFFFFF;
+ vt.vtm_data = 0xFFFFFFFFFFFFFFFF;
+
+ // Test >>
+
+ Console.WriteLine("The expected result of (0xFFFFFFFFFFFFFFFF>>8) is: {0}", (0xFFFFFFFFFFFFFFFF >> 8));
+ Console.WriteLine();
+
+ Console.WriteLine("The actual result for funciton argument is: {0}", f1(0xFFFFFFFFFFFFFFFF));
+ loc_data >>= 8;
+ Console.WriteLine("The actual result for local variable is: {0}", loc_data);
+ s_data >>= 8;
+ Console.WriteLine("The actual result for static field is: {0}", s_data);
+ arr_data[0] >>= 8;
+ Console.WriteLine("The actual result for array element is: {0}", arr_data[0]);
+ cl.clm_data >>= 8;
+ Console.WriteLine("The actual result for class member is: {0}", cl.clm_data);
+ vt.vtm_data >>= 8;
+ Console.WriteLine("The actual result for valuestruct member is: {0}", vt.vtm_data);
+
+ Console.WriteLine();
+
+ if (loc_data != (0xFFFFFFFFFFFFFFFF >> 8))
+ {
+ Console.WriteLine("FAILED for local variable");
+ return -1;
+ }
+ if (f1(0xFFFFFFFFFFFFFFFF) != (0xFFFFFFFFFFFFFFFF >> 8))
+ {
+ Console.WriteLine("FAILED for function argument");
+ return -1;
+ }
+ if (s_data != (0xFFFFFFFFFFFFFFFF >> 8))
+ {
+ Console.WriteLine("FAILED for static field");
+ return -1;
+ }
+ if (arr_data[0] != (0xFFFFFFFFFFFFFFFF >> 8))
+ {
+ Console.WriteLine("FAILED for array element");
+ return -1;
+ }
+ if (cl.clm_data != (0xFFFFFFFFFFFFFFFF >> 8))
+ {
+ Console.WriteLine("FAILED for class member");
+ return -1;
+ }
+ if (vt.vtm_data != (0xFFFFFFFFFFFFFFFF >> 8))
+ {
+ Console.WriteLine("FAILED for valuestruct member");
+ return -1;
+ }
+
+ // Test <<
+
+ s_data = 0x1;
+ loc_data = 0x1;
+ arr_data[0] = 0x1;
+ cl.clm_data = 0x1;
+ vt.vtm_data = 0x1;
+
+ Console.WriteLine("The expected result of (0x1<<8) is: {0}", ((ulong)0x1 << 8));
+ Console.WriteLine();
+
+ Console.WriteLine("The actual result for funciton argument is: {0}", f2(0x1));
+ loc_data <<= 8;
+ Console.WriteLine("The actual result for local variable is: {0}", loc_data);
+ s_data <<= 8;
+ Console.WriteLine("The actual result for static field is: {0}", s_data);
+ arr_data[0] <<= 8;
+ Console.WriteLine("The actual result for array element is: {0}", arr_data[0]);
+ cl.clm_data <<= 8;
+ Console.WriteLine("The actual result for class member is: {0}", cl.clm_data);
+ vt.vtm_data <<= 8;
+ Console.WriteLine("The actual result for valuestruct member is: {0}", vt.vtm_data);
+
+ Console.WriteLine();
+
+ if (loc_data != (0x1 << 8))
+ {
+ Console.WriteLine("FAILED for local variable");
+ return -1;
+ }
+ if (f2(0x1) != (0x1 << 8))
+ {
+ Console.WriteLine("FAILED for function argument");
+ return -1;
+ }
+ if (s_data != (0x1 << 8))
+ {
+ Console.WriteLine("FAILED for static field");
+ return -1;
+ }
+ if (arr_data[0] != (0x1 << 8))
+ {
+ Console.WriteLine("FAILED for array element");
+ return -1;
+ }
+ if (cl.clm_data != (0x1 << 8))
+ {
+ Console.WriteLine("FAILED for class member");
+ return -1;
+ }
+ if (vt.vtm_data != (0x1 << 8))
+ {
+ Console.WriteLine("FAILED for valuestruct member");
+ return -1;
+ }
+
+ Console.WriteLine("PASSED");
+ return 100;
+ }
+ }
+}
diff --git a/tests/src/JIT/Directed/shift/uint8.cs b/tests/src/JIT/Directed/shift/uint8.cs
new file mode 100644
index 0000000000..7fb892b52d
--- /dev/null
+++ b/tests/src/JIT/Directed/shift/uint8.cs
@@ -0,0 +1,155 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+//
+
+using System;
+
+namespace ShiftTest
+{
+ public class CL
+ {
+ public byte clm_data = 0xFF;
+ }
+ public struct VT
+ {
+ public byte vtm_data;
+ }
+ public class byte32Test
+ {
+ private static byte s_data = 0xFF;
+ public static byte f1(byte arg_data)
+ {
+ arg_data >>= 4;
+ return arg_data;
+ }
+ public static byte f2(byte arg_data)
+ {
+ arg_data <<= 4;
+ return arg_data;
+ }
+ public static int Main()
+ {
+ byte loc_data = 0xFF;
+
+ byte[] arr_data = new byte[1];
+
+ CL cl = new CL();
+ VT vt;
+
+ s_data = 0xFF;
+ loc_data = 0xFF;
+ arr_data[0] = 0xFF;
+ cl.clm_data = 0xFF;
+ vt.vtm_data = 0xFF;
+
+ // Test >>
+
+ Console.WriteLine("The expected result of (0xFF>>4) is: {0}", (0xFF >> 4));
+ Console.WriteLine();
+
+ Console.WriteLine("The actual result for funciton argument is: {0}", f1(0xFF));
+ loc_data >>= 4;
+ Console.WriteLine("The actual result for local variable is: {0}", loc_data);
+ s_data >>= 4;
+ Console.WriteLine("The actual result for static field is: {0}", s_data);
+ arr_data[0] >>= 4;
+ Console.WriteLine("The actual result for array element is: {0}", arr_data[0]);
+ cl.clm_data >>= 4;
+ Console.WriteLine("The actual result for class member is: {0}", cl.clm_data);
+ vt.vtm_data >>= 4;
+ Console.WriteLine("The actual result for valuestruct member is: {0}", vt.vtm_data);
+
+ Console.WriteLine();
+
+ if (loc_data != (0xFF >> 4))
+ {
+ Console.WriteLine("FAILED for local variable");
+ return -1;
+ }
+ if (f1(0xFF) != (0xFF >> 4))
+ {
+ Console.WriteLine("FAILED for function argument");
+ return -1;
+ }
+ if (s_data != (0xFF >> 4))
+ {
+ Console.WriteLine("FAILED for static field");
+ return -1;
+ }
+ if (arr_data[0] != (0xFF >> 4))
+ {
+ Console.WriteLine("FAILED for array element");
+ return -1;
+ }
+ if (cl.clm_data != (0xFF >> 4))
+ {
+ Console.WriteLine("FAILED for class member");
+ return -1;
+ }
+ if (vt.vtm_data != (0xFF >> 4))
+ {
+ Console.WriteLine("FAILED for valuestruct member");
+ return -1;
+ }
+
+ // Test <<
+
+ s_data = 0x1;
+ loc_data = 0x1;
+ arr_data[0] = 0x1;
+ cl.clm_data = 0x1;
+ vt.vtm_data = 0x1;
+
+ Console.WriteLine("The expected result of (0x1<<4) is: {0}", ((byte)0x1 << 4));
+ Console.WriteLine();
+
+ Console.WriteLine("The actual result for funciton argument is: {0}", f2(0x1));
+ loc_data <<= 4;
+ Console.WriteLine("The actual result for local variable is: {0}", loc_data);
+ s_data <<= 4;
+ Console.WriteLine("The actual result for static field is: {0}", s_data);
+ arr_data[0] <<= 4;
+ Console.WriteLine("The actual result for array element is: {0}", arr_data[0]);
+ cl.clm_data <<= 4;
+ Console.WriteLine("The actual result for class member is: {0}", cl.clm_data);
+ vt.vtm_data <<= 4;
+ Console.WriteLine("The actual result for valuestruct member is: {0}", vt.vtm_data);
+
+ Console.WriteLine();
+
+ if (loc_data != (0x1 << 4))
+ {
+ Console.WriteLine("FAILED for local variable");
+ return -1;
+ }
+ if (f2(0x1) != (0x1 << 4))
+ {
+ Console.WriteLine("FAILED for function argument");
+ return -1;
+ }
+ if (s_data != (0x1 << 4))
+ {
+ Console.WriteLine("FAILED for static field");
+ return -1;
+ }
+ if (arr_data[0] != (0x1 << 4))
+ {
+ Console.WriteLine("FAILED for array element");
+ return -1;
+ }
+ if (cl.clm_data != (0x1 << 4))
+ {
+ Console.WriteLine("FAILED for class member");
+ return -1;
+ }
+ if (vt.vtm_data != (0x1 << 4))
+ {
+ Console.WriteLine("FAILED for valuestruct member");
+ return -1;
+ }
+
+ Console.WriteLine("PASSED");
+ return 100;
+ }
+ }
+}