mirror of
https://github.com/VSadov/Satori.git
synced 2025-06-10 10:00:57 +09:00
Merge pull request dotnet/coreclr#1041 from pgavlin/JITMethodical
Import more JIT tests.
Commit migrated from 2e7885d43f
This commit is contained in:
commit
c0e41dbfa5
397 changed files with 41313 additions and 8 deletions
|
@ -1,6 +1,5 @@
|
|||
// 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
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
|
|
|
@ -39,4 +39,4 @@
|
|||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
|
||||
<PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
</Project>
|
|
@ -1,6 +1,5 @@
|
|||
// 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
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// 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
|
||||
|
||||
|
|
|
@ -0,0 +1,558 @@
|
|||
// 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 _i_num;
|
||||
private uint _ui_num;
|
||||
private long _l_num;
|
||||
private ulong _ul_num;
|
||||
private float _f_num;
|
||||
private double _d_num;
|
||||
private decimal _m_num;
|
||||
public numHolder(int i_num)
|
||||
{
|
||||
_i_num = Convert.ToInt32(i_num);
|
||||
_ui_num = Convert.ToUInt32(i_num);
|
||||
_l_num = Convert.ToInt64(i_num);
|
||||
_ul_num = Convert.ToUInt64(i_num);
|
||||
_f_num = Convert.ToSingle(i_num);
|
||||
_d_num = Convert.ToDouble(i_num);
|
||||
_m_num = Convert.ToDecimal(i_num);
|
||||
}
|
||||
|
||||
public static int operator +(numHolder a, int b)
|
||||
{
|
||||
return a._i_num + b;
|
||||
}
|
||||
|
||||
public numHolder(uint ui_num)
|
||||
{
|
||||
_i_num = Convert.ToInt32(ui_num);
|
||||
_ui_num = Convert.ToUInt32(ui_num);
|
||||
_l_num = Convert.ToInt64(ui_num);
|
||||
_ul_num = Convert.ToUInt64(ui_num);
|
||||
_f_num = Convert.ToSingle(ui_num);
|
||||
_d_num = Convert.ToDouble(ui_num);
|
||||
_m_num = Convert.ToDecimal(ui_num);
|
||||
}
|
||||
|
||||
public static uint operator +(numHolder a, uint b)
|
||||
{
|
||||
return a._ui_num + b;
|
||||
}
|
||||
|
||||
public numHolder(long l_num)
|
||||
{
|
||||
_i_num = Convert.ToInt32(l_num);
|
||||
_ui_num = Convert.ToUInt32(l_num);
|
||||
_l_num = Convert.ToInt64(l_num);
|
||||
_ul_num = Convert.ToUInt64(l_num);
|
||||
_f_num = Convert.ToSingle(l_num);
|
||||
_d_num = Convert.ToDouble(l_num);
|
||||
_m_num = Convert.ToDecimal(l_num);
|
||||
}
|
||||
|
||||
public static long operator +(numHolder a, long b)
|
||||
{
|
||||
return a._l_num + b;
|
||||
}
|
||||
|
||||
public numHolder(ulong ul_num)
|
||||
{
|
||||
_i_num = Convert.ToInt32(ul_num);
|
||||
_ui_num = Convert.ToUInt32(ul_num);
|
||||
_l_num = Convert.ToInt64(ul_num);
|
||||
_ul_num = Convert.ToUInt64(ul_num);
|
||||
_f_num = Convert.ToSingle(ul_num);
|
||||
_d_num = Convert.ToDouble(ul_num);
|
||||
_m_num = Convert.ToDecimal(ul_num);
|
||||
}
|
||||
|
||||
public static long operator +(numHolder a, ulong b)
|
||||
{
|
||||
return (long)(a._ul_num + b);
|
||||
}
|
||||
|
||||
public numHolder(float f_num)
|
||||
{
|
||||
_i_num = Convert.ToInt32(f_num);
|
||||
_ui_num = Convert.ToUInt32(f_num);
|
||||
_l_num = Convert.ToInt64(f_num);
|
||||
_ul_num = Convert.ToUInt64(f_num);
|
||||
_f_num = Convert.ToSingle(f_num);
|
||||
_d_num = Convert.ToDouble(f_num);
|
||||
_m_num = Convert.ToDecimal(f_num);
|
||||
}
|
||||
|
||||
public static float operator +(numHolder a, float b)
|
||||
{
|
||||
return a._f_num + b;
|
||||
}
|
||||
|
||||
public numHolder(double d_num)
|
||||
{
|
||||
_i_num = Convert.ToInt32(d_num);
|
||||
_ui_num = Convert.ToUInt32(d_num);
|
||||
_l_num = Convert.ToInt64(d_num);
|
||||
_ul_num = Convert.ToUInt64(d_num);
|
||||
_f_num = Convert.ToSingle(d_num);
|
||||
_d_num = Convert.ToDouble(d_num);
|
||||
_m_num = Convert.ToDecimal(d_num);
|
||||
}
|
||||
|
||||
public static double operator +(numHolder a, double b)
|
||||
{
|
||||
return a._d_num + b;
|
||||
}
|
||||
|
||||
public numHolder(decimal m_num)
|
||||
{
|
||||
_i_num = Convert.ToInt32(m_num);
|
||||
_ui_num = Convert.ToUInt32(m_num);
|
||||
_l_num = Convert.ToInt64(m_num);
|
||||
_ul_num = Convert.ToUInt64(m_num);
|
||||
_f_num = Convert.ToSingle(m_num);
|
||||
_d_num = Convert.ToDouble(m_num);
|
||||
_m_num = Convert.ToDecimal(m_num);
|
||||
}
|
||||
|
||||
public static int operator +(numHolder a, decimal b)
|
||||
{
|
||||
return (int)(a._m_num + b);
|
||||
}
|
||||
|
||||
public static int operator +(numHolder a, numHolder b)
|
||||
{
|
||||
return a._i_num + b._i_num;
|
||||
}
|
||||
}
|
||||
|
||||
private static int s_i_s_op1 = 1;
|
||||
private static uint s_ui_s_op1 = 1;
|
||||
private static long s_l_s_op1 = 1;
|
||||
private static ulong s_ul_s_op1 = 1;
|
||||
private static float s_f_s_op1 = 1;
|
||||
private static double s_d_s_op1 = 1;
|
||||
private static decimal s_m_s_op1 = 1;
|
||||
|
||||
private static int s_i_s_op2 = 8;
|
||||
private static uint s_ui_s_op2 = 8;
|
||||
private static long s_l_s_op2 = 8;
|
||||
private static ulong s_ul_s_op2 = 8;
|
||||
private static float s_f_s_op2 = 8;
|
||||
private static double s_d_s_op2 = 8;
|
||||
private static decimal s_m_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_i_s_op2 != i_l_op1 + s_ui_s_op2) || (i_l_op1 + s_ui_s_op2 != i_l_op1 + s_l_s_op2) || (i_l_op1 + s_l_s_op2 != i_l_op1 + (int)s_ul_s_op2) || (i_l_op1 + (int)s_ul_s_op2 != i_l_op1 + s_f_s_op2) || (i_l_op1 + s_f_s_op2 != i_l_op1 + s_d_s_op2) || ((decimal)(i_l_op1 + s_d_s_op2) != i_l_op1 + s_m_s_op2) || (i_l_op1 + s_m_s_op2 != i_l_op1 + s_i_s_op2) || (i_l_op1 + s_i_s_op2 != 9))
|
||||
{
|
||||
Console.WriteLine("testcase 2 failed");
|
||||
passed = false;
|
||||
}
|
||||
if ((s_i_s_op1 + i_l_op2 != s_i_s_op1 + ui_l_op2) || (s_i_s_op1 + ui_l_op2 != s_i_s_op1 + l_l_op2) || (s_i_s_op1 + l_l_op2 != s_i_s_op1 + (int)ul_l_op2) || (s_i_s_op1 + (int)ul_l_op2 != s_i_s_op1 + f_l_op2) || (s_i_s_op1 + f_l_op2 != s_i_s_op1 + d_l_op2) || ((decimal)(s_i_s_op1 + d_l_op2) != s_i_s_op1 + m_l_op2) || (s_i_s_op1 + m_l_op2 != s_i_s_op1 + i_l_op2) || (s_i_s_op1 + i_l_op2 != 9))
|
||||
{
|
||||
Console.WriteLine("testcase 3 failed");
|
||||
passed = false;
|
||||
}
|
||||
if ((s_i_s_op1 + s_i_s_op2 != s_i_s_op1 + s_ui_s_op2) || (s_i_s_op1 + s_ui_s_op2 != s_i_s_op1 + s_l_s_op2) || (s_i_s_op1 + s_l_s_op2 != s_i_s_op1 + (int)s_ul_s_op2) || (s_i_s_op1 + (int)s_ul_s_op2 != s_i_s_op1 + s_f_s_op2) || (s_i_s_op1 + s_f_s_op2 != s_i_s_op1 + s_d_s_op2) || ((decimal)(s_i_s_op1 + s_d_s_op2) != s_i_s_op1 + s_m_s_op2) || (s_i_s_op1 + s_m_s_op2 != s_i_s_op1 + s_i_s_op2) || (s_i_s_op1 + s_i_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_i_s_op2 != ui_l_op1 + s_ui_s_op2) || (ui_l_op1 + s_ui_s_op2 != ui_l_op1 + s_l_s_op2) || ((ulong)(ui_l_op1 + s_l_s_op2) != ui_l_op1 + s_ul_s_op2) || (ui_l_op1 + s_ul_s_op2 != ui_l_op1 + s_f_s_op2) || (ui_l_op1 + s_f_s_op2 != ui_l_op1 + s_d_s_op2) || ((decimal)(ui_l_op1 + s_d_s_op2) != ui_l_op1 + s_m_s_op2) || (ui_l_op1 + s_m_s_op2 != ui_l_op1 + s_i_s_op2) || (ui_l_op1 + s_i_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_i_s_op2 != s_ui_s_op1 + s_ui_s_op2) || (s_ui_s_op1 + s_ui_s_op2 != s_ui_s_op1 + s_l_s_op2) || ((ulong)(s_ui_s_op1 + s_l_s_op2) != s_ui_s_op1 + s_ul_s_op2) || (s_ui_s_op1 + s_ul_s_op2 != s_ui_s_op1 + s_f_s_op2) || (s_ui_s_op1 + s_f_s_op2 != s_ui_s_op1 + s_d_s_op2) || ((decimal)(s_ui_s_op1 + s_d_s_op2) != s_ui_s_op1 + s_m_s_op2) || (s_ui_s_op1 + s_m_s_op2 != s_ui_s_op1 + s_i_s_op2) || (s_ui_s_op1 + s_i_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_i_s_op2 != l_l_op1 + s_ui_s_op2) || (l_l_op1 + s_ui_s_op2 != l_l_op1 + s_l_s_op2) || (l_l_op1 + s_l_s_op2 != l_l_op1 + (long)s_ul_s_op2) || (l_l_op1 + (long)s_ul_s_op2 != l_l_op1 + s_f_s_op2) || (l_l_op1 + s_f_s_op2 != l_l_op1 + s_d_s_op2) || ((decimal)(l_l_op1 + s_d_s_op2) != l_l_op1 + s_m_s_op2) || (l_l_op1 + s_m_s_op2 != l_l_op1 + s_i_s_op2) || (l_l_op1 + s_i_s_op2 != 9))
|
||||
{
|
||||
Console.WriteLine("testcase 10 failed");
|
||||
passed = false;
|
||||
}
|
||||
if ((s_l_s_op1 + i_l_op2 != s_l_s_op1 + ui_l_op2) || (s_l_s_op1 + ui_l_op2 != s_l_s_op1 + l_l_op2) || (s_l_s_op1 + l_l_op2 != s_l_s_op1 + (long)ul_l_op2) || (s_l_s_op1 + (long)ul_l_op2 != s_l_s_op1 + f_l_op2) || (s_l_s_op1 + f_l_op2 != s_l_s_op1 + d_l_op2) || ((decimal)(s_l_s_op1 + d_l_op2) != s_l_s_op1 + m_l_op2) || (s_l_s_op1 + m_l_op2 != s_l_s_op1 + i_l_op2) || (s_l_s_op1 + i_l_op2 != 9))
|
||||
{
|
||||
Console.WriteLine("testcase 11 failed");
|
||||
passed = false;
|
||||
}
|
||||
if ((s_l_s_op1 + s_i_s_op2 != s_l_s_op1 + s_ui_s_op2) || (s_l_s_op1 + s_ui_s_op2 != s_l_s_op1 + s_l_s_op2) || (s_l_s_op1 + s_l_s_op2 != s_l_s_op1 + (long)s_ul_s_op2) || (s_l_s_op1 + (long)s_ul_s_op2 != s_l_s_op1 + s_f_s_op2) || (s_l_s_op1 + s_f_s_op2 != s_l_s_op1 + s_d_s_op2) || ((decimal)(s_l_s_op1 + s_d_s_op2) != s_l_s_op1 + s_m_s_op2) || (s_l_s_op1 + s_m_s_op2 != s_l_s_op1 + s_i_s_op2) || (s_l_s_op1 + s_i_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_i_s_op2 != ul_l_op1 + s_ui_s_op2) || (ul_l_op1 + s_ui_s_op2 != ul_l_op1 + (ulong)s_l_s_op2) || (ul_l_op1 + (ulong)s_l_s_op2 != ul_l_op1 + s_ul_s_op2) || (ul_l_op1 + s_ul_s_op2 != ul_l_op1 + s_f_s_op2) || (ul_l_op1 + s_f_s_op2 != ul_l_op1 + s_d_s_op2) || ((decimal)(ul_l_op1 + s_d_s_op2) != ul_l_op1 + s_m_s_op2) || (ul_l_op1 + s_m_s_op2 != ul_l_op1 + (ulong)s_i_s_op2) || (ul_l_op1 + (ulong)s_i_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_i_s_op2 != s_ul_s_op1 + s_ui_s_op2) || (s_ul_s_op1 + s_ui_s_op2 != s_ul_s_op1 + (ulong)s_l_s_op2) || (s_ul_s_op1 + (ulong)s_l_s_op2 != s_ul_s_op1 + s_ul_s_op2) || (s_ul_s_op1 + s_ul_s_op2 != s_ul_s_op1 + s_f_s_op2) || (s_ul_s_op1 + s_f_s_op2 != s_ul_s_op1 + s_d_s_op2) || ((decimal)(s_ul_s_op1 + s_d_s_op2) != s_ul_s_op1 + s_m_s_op2) || (s_ul_s_op1 + s_m_s_op2 != s_ul_s_op1 + (ulong)s_i_s_op2) || (s_ul_s_op1 + (ulong)s_i_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_i_s_op2 != f_l_op1 + s_ui_s_op2) || (f_l_op1 + s_ui_s_op2 != f_l_op1 + s_l_s_op2) || (f_l_op1 + s_l_s_op2 != f_l_op1 + s_ul_s_op2) || (f_l_op1 + s_ul_s_op2 != f_l_op1 + s_f_s_op2) || (f_l_op1 + s_f_s_op2 != f_l_op1 + s_d_s_op2) || (f_l_op1 + s_d_s_op2 != f_l_op1 + (float)s_m_s_op2) || (f_l_op1 + (float)s_m_s_op2 != f_l_op1 + s_i_s_op2) || (f_l_op1 + s_i_s_op2 != 9))
|
||||
{
|
||||
Console.WriteLine("testcase 18 failed");
|
||||
passed = false;
|
||||
}
|
||||
if ((s_f_s_op1 + i_l_op2 != s_f_s_op1 + ui_l_op2) || (s_f_s_op1 + ui_l_op2 != s_f_s_op1 + l_l_op2) || (s_f_s_op1 + l_l_op2 != s_f_s_op1 + ul_l_op2) || (s_f_s_op1 + ul_l_op2 != s_f_s_op1 + f_l_op2) || (s_f_s_op1 + f_l_op2 != s_f_s_op1 + d_l_op2) || (s_f_s_op1 + d_l_op2 != s_f_s_op1 + (float)m_l_op2) || (s_f_s_op1 + (float)m_l_op2 != s_f_s_op1 + i_l_op2) || (s_f_s_op1 + i_l_op2 != 9))
|
||||
{
|
||||
Console.WriteLine("testcase 19 failed");
|
||||
passed = false;
|
||||
}
|
||||
if ((s_f_s_op1 + s_i_s_op2 != s_f_s_op1 + s_ui_s_op2) || (s_f_s_op1 + s_ui_s_op2 != s_f_s_op1 + s_l_s_op2) || (s_f_s_op1 + s_l_s_op2 != s_f_s_op1 + s_ul_s_op2) || (s_f_s_op1 + s_ul_s_op2 != s_f_s_op1 + s_f_s_op2) || (s_f_s_op1 + s_f_s_op2 != s_f_s_op1 + s_d_s_op2) || (s_f_s_op1 + s_d_s_op2 != s_f_s_op1 + (float)s_m_s_op2) || (s_f_s_op1 + (float)s_m_s_op2 != s_f_s_op1 + s_i_s_op2) || (s_f_s_op1 + s_i_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_i_s_op2 != d_l_op1 + s_ui_s_op2) || (d_l_op1 + s_ui_s_op2 != d_l_op1 + s_l_s_op2) || (d_l_op1 + s_l_s_op2 != d_l_op1 + s_ul_s_op2) || (d_l_op1 + s_ul_s_op2 != d_l_op1 + s_f_s_op2) || (d_l_op1 + s_f_s_op2 != d_l_op1 + s_d_s_op2) || (d_l_op1 + s_d_s_op2 != d_l_op1 + (double)s_m_s_op2) || (d_l_op1 + (double)s_m_s_op2 != d_l_op1 + s_i_s_op2) || (d_l_op1 + s_i_s_op2 != 9))
|
||||
{
|
||||
Console.WriteLine("testcase 22 failed");
|
||||
passed = false;
|
||||
}
|
||||
if ((s_d_s_op1 + i_l_op2 != s_d_s_op1 + ui_l_op2) || (s_d_s_op1 + ui_l_op2 != s_d_s_op1 + l_l_op2) || (s_d_s_op1 + l_l_op2 != s_d_s_op1 + ul_l_op2) || (s_d_s_op1 + ul_l_op2 != s_d_s_op1 + f_l_op2) || (s_d_s_op1 + f_l_op2 != s_d_s_op1 + d_l_op2) || (s_d_s_op1 + d_l_op2 != s_d_s_op1 + (double)m_l_op2) || (s_d_s_op1 + (double)m_l_op2 != s_d_s_op1 + i_l_op2) || (s_d_s_op1 + i_l_op2 != 9))
|
||||
{
|
||||
Console.WriteLine("testcase 23 failed");
|
||||
passed = false;
|
||||
}
|
||||
if ((s_d_s_op1 + s_i_s_op2 != s_d_s_op1 + s_ui_s_op2) || (s_d_s_op1 + s_ui_s_op2 != s_d_s_op1 + s_l_s_op2) || (s_d_s_op1 + s_l_s_op2 != s_d_s_op1 + s_ul_s_op2) || (s_d_s_op1 + s_ul_s_op2 != s_d_s_op1 + s_f_s_op2) || (s_d_s_op1 + s_f_s_op2 != s_d_s_op1 + s_d_s_op2) || (s_d_s_op1 + s_d_s_op2 != s_d_s_op1 + (double)s_m_s_op2) || (s_d_s_op1 + (double)s_m_s_op2 != s_d_s_op1 + s_i_s_op2) || (s_d_s_op1 + s_i_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_i_s_op2 != m_l_op1 + s_ui_s_op2) || (m_l_op1 + s_ui_s_op2 != m_l_op1 + s_l_s_op2) || (m_l_op1 + s_l_s_op2 != m_l_op1 + s_ul_s_op2) || (m_l_op1 + s_ul_s_op2 != m_l_op1 + (decimal)s_f_s_op2) || (m_l_op1 + (decimal)s_f_s_op2 != m_l_op1 + (decimal)s_d_s_op2) || (m_l_op1 + (decimal)s_d_s_op2 != m_l_op1 + s_m_s_op2) || (m_l_op1 + s_m_s_op2 != m_l_op1 + s_i_s_op2) || (m_l_op1 + s_i_s_op2 != 9))
|
||||
{
|
||||
Console.WriteLine("testcase 26 failed");
|
||||
passed = false;
|
||||
}
|
||||
if ((s_m_s_op1 + i_l_op2 != s_m_s_op1 + ui_l_op2) || (s_m_s_op1 + ui_l_op2 != s_m_s_op1 + l_l_op2) || (s_m_s_op1 + l_l_op2 != s_m_s_op1 + ul_l_op2) || (s_m_s_op1 + ul_l_op2 != s_m_s_op1 + (decimal)f_l_op2) || (s_m_s_op1 + (decimal)f_l_op2 != s_m_s_op1 + (decimal)d_l_op2) || (s_m_s_op1 + (decimal)d_l_op2 != s_m_s_op1 + m_l_op2) || (s_m_s_op1 + m_l_op2 != s_m_s_op1 + i_l_op2) || (s_m_s_op1 + i_l_op2 != 9))
|
||||
{
|
||||
Console.WriteLine("testcase 27 failed");
|
||||
passed = false;
|
||||
}
|
||||
if ((s_m_s_op1 + s_i_s_op2 != s_m_s_op1 + s_ui_s_op2) || (s_m_s_op1 + s_ui_s_op2 != s_m_s_op1 + s_l_s_op2) || (s_m_s_op1 + s_l_s_op2 != s_m_s_op1 + s_ul_s_op2) || (s_m_s_op1 + s_ul_s_op2 != s_m_s_op1 + (decimal)s_f_s_op2) || (s_m_s_op1 + (decimal)s_f_s_op2 != s_m_s_op1 + (decimal)s_d_s_op2) || (s_m_s_op1 + (decimal)s_d_s_op2 != s_m_s_op1 + s_m_s_op2) || (s_m_s_op1 + s_m_s_op2 != s_m_s_op1 + s_i_s_op2) || (s_m_s_op1 + s_i_s_op2 != 9))
|
||||
{
|
||||
Console.WriteLine("testcase 28 failed");
|
||||
passed = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!passed)
|
||||
{
|
||||
Console.WriteLine("FAILED");
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("PASSED");
|
||||
return 100;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,558 @@
|
|||
// 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 _i_num;
|
||||
private uint _ui_num;
|
||||
private long _l_num;
|
||||
private ulong _ul_num;
|
||||
private float _f_num;
|
||||
private double _d_num;
|
||||
private decimal _m_num;
|
||||
public numHolder(int i_num)
|
||||
{
|
||||
_i_num = Convert.ToInt32(i_num);
|
||||
_ui_num = Convert.ToUInt32(i_num);
|
||||
_l_num = Convert.ToInt64(i_num);
|
||||
_ul_num = Convert.ToUInt64(i_num);
|
||||
_f_num = Convert.ToSingle(i_num);
|
||||
_d_num = Convert.ToDouble(i_num);
|
||||
_m_num = Convert.ToDecimal(i_num);
|
||||
}
|
||||
|
||||
public static int operator /(numHolder a, int b)
|
||||
{
|
||||
return a._i_num / b;
|
||||
}
|
||||
|
||||
public numHolder(uint ui_num)
|
||||
{
|
||||
_i_num = Convert.ToInt32(ui_num);
|
||||
_ui_num = Convert.ToUInt32(ui_num);
|
||||
_l_num = Convert.ToInt64(ui_num);
|
||||
_ul_num = Convert.ToUInt64(ui_num);
|
||||
_f_num = Convert.ToSingle(ui_num);
|
||||
_d_num = Convert.ToDouble(ui_num);
|
||||
_m_num = Convert.ToDecimal(ui_num);
|
||||
}
|
||||
|
||||
public static uint operator /(numHolder a, uint b)
|
||||
{
|
||||
return a._ui_num / b;
|
||||
}
|
||||
|
||||
public numHolder(long l_num)
|
||||
{
|
||||
_i_num = Convert.ToInt32(l_num);
|
||||
_ui_num = Convert.ToUInt32(l_num);
|
||||
_l_num = Convert.ToInt64(l_num);
|
||||
_ul_num = Convert.ToUInt64(l_num);
|
||||
_f_num = Convert.ToSingle(l_num);
|
||||
_d_num = Convert.ToDouble(l_num);
|
||||
_m_num = Convert.ToDecimal(l_num);
|
||||
}
|
||||
|
||||
public static long operator /(numHolder a, long b)
|
||||
{
|
||||
return a._l_num / b;
|
||||
}
|
||||
|
||||
public numHolder(ulong ul_num)
|
||||
{
|
||||
_i_num = Convert.ToInt32(ul_num);
|
||||
_ui_num = Convert.ToUInt32(ul_num);
|
||||
_l_num = Convert.ToInt64(ul_num);
|
||||
_ul_num = Convert.ToUInt64(ul_num);
|
||||
_f_num = Convert.ToSingle(ul_num);
|
||||
_d_num = Convert.ToDouble(ul_num);
|
||||
_m_num = Convert.ToDecimal(ul_num);
|
||||
}
|
||||
|
||||
public static long operator /(numHolder a, ulong b)
|
||||
{
|
||||
return (long)(a._ul_num / b);
|
||||
}
|
||||
|
||||
public numHolder(float f_num)
|
||||
{
|
||||
_i_num = Convert.ToInt32(f_num);
|
||||
_ui_num = Convert.ToUInt32(f_num);
|
||||
_l_num = Convert.ToInt64(f_num);
|
||||
_ul_num = Convert.ToUInt64(f_num);
|
||||
_f_num = Convert.ToSingle(f_num);
|
||||
_d_num = Convert.ToDouble(f_num);
|
||||
_m_num = Convert.ToDecimal(f_num);
|
||||
}
|
||||
|
||||
public static float operator /(numHolder a, float b)
|
||||
{
|
||||
return a._f_num / b;
|
||||
}
|
||||
|
||||
public numHolder(double d_num)
|
||||
{
|
||||
_i_num = Convert.ToInt32(d_num);
|
||||
_ui_num = Convert.ToUInt32(d_num);
|
||||
_l_num = Convert.ToInt64(d_num);
|
||||
_ul_num = Convert.ToUInt64(d_num);
|
||||
_f_num = Convert.ToSingle(d_num);
|
||||
_d_num = Convert.ToDouble(d_num);
|
||||
_m_num = Convert.ToDecimal(d_num);
|
||||
}
|
||||
|
||||
public static double operator /(numHolder a, double b)
|
||||
{
|
||||
return a._d_num / b;
|
||||
}
|
||||
|
||||
public numHolder(decimal m_num)
|
||||
{
|
||||
_i_num = Convert.ToInt32(m_num);
|
||||
_ui_num = Convert.ToUInt32(m_num);
|
||||
_l_num = Convert.ToInt64(m_num);
|
||||
_ul_num = Convert.ToUInt64(m_num);
|
||||
_f_num = Convert.ToSingle(m_num);
|
||||
_d_num = Convert.ToDouble(m_num);
|
||||
_m_num = Convert.ToDecimal(m_num);
|
||||
}
|
||||
|
||||
public static int operator /(numHolder a, decimal b)
|
||||
{
|
||||
return (int)(a._m_num / b);
|
||||
}
|
||||
|
||||
public static int operator /(numHolder a, numHolder b)
|
||||
{
|
||||
return a._i_num / b._i_num;
|
||||
}
|
||||
}
|
||||
|
||||
private static int s_i_s_op1 = 128;
|
||||
private static uint s_ui_s_op1 = 128;
|
||||
private static long s_l_s_op1 = 128;
|
||||
private static ulong s_ul_s_op1 = 128;
|
||||
private static float s_f_s_op1 = 128;
|
||||
private static double s_d_s_op1 = 128;
|
||||
private static decimal s_m_s_op1 = 128;
|
||||
|
||||
private static int s_i_s_op2 = 4;
|
||||
private static uint s_ui_s_op2 = 4;
|
||||
private static long s_l_s_op2 = 4;
|
||||
private static ulong s_ul_s_op2 = 4;
|
||||
private static float s_f_s_op2 = 4;
|
||||
private static double s_d_s_op2 = 4;
|
||||
private static decimal s_m_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_i_s_op2 != i_l_op1 / s_ui_s_op2) || (i_l_op1 / s_ui_s_op2 != i_l_op1 / s_l_s_op2) || (i_l_op1 / s_l_s_op2 != i_l_op1 / (int)s_ul_s_op2) || (i_l_op1 / (int)s_ul_s_op2 != i_l_op1 / s_f_s_op2) || (i_l_op1 / s_f_s_op2 != i_l_op1 / s_d_s_op2) || ((decimal)(i_l_op1 / s_d_s_op2) != i_l_op1 / s_m_s_op2) || (i_l_op1 / s_m_s_op2 != i_l_op1 / s_i_s_op2) || (i_l_op1 / s_i_s_op2 != 32))
|
||||
{
|
||||
Console.WriteLine("testcase 2 failed");
|
||||
passed = false;
|
||||
}
|
||||
if ((s_i_s_op1 / i_l_op2 != s_i_s_op1 / ui_l_op2) || (s_i_s_op1 / ui_l_op2 != s_i_s_op1 / l_l_op2) || (s_i_s_op1 / l_l_op2 != s_i_s_op1 / (int)ul_l_op2) || (s_i_s_op1 / (int)ul_l_op2 != s_i_s_op1 / f_l_op2) || (s_i_s_op1 / f_l_op2 != s_i_s_op1 / d_l_op2) || ((decimal)(s_i_s_op1 / d_l_op2) != s_i_s_op1 / m_l_op2) || (s_i_s_op1 / m_l_op2 != s_i_s_op1 / i_l_op2) || (s_i_s_op1 / i_l_op2 != 32))
|
||||
{
|
||||
Console.WriteLine("testcase 3 failed");
|
||||
passed = false;
|
||||
}
|
||||
if ((s_i_s_op1 / s_i_s_op2 != s_i_s_op1 / s_ui_s_op2) || (s_i_s_op1 / s_ui_s_op2 != s_i_s_op1 / s_l_s_op2) || (s_i_s_op1 / s_l_s_op2 != s_i_s_op1 / (int)s_ul_s_op2) || (s_i_s_op1 / (int)s_ul_s_op2 != s_i_s_op1 / s_f_s_op2) || (s_i_s_op1 / s_f_s_op2 != s_i_s_op1 / s_d_s_op2) || ((decimal)(s_i_s_op1 / s_d_s_op2) != s_i_s_op1 / s_m_s_op2) || (s_i_s_op1 / s_m_s_op2 != s_i_s_op1 / s_i_s_op2) || (s_i_s_op1 / s_i_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_i_s_op2 != ui_l_op1 / s_ui_s_op2) || (ui_l_op1 / s_ui_s_op2 != ui_l_op1 / s_l_s_op2) || ((ulong)(ui_l_op1 / s_l_s_op2) != ui_l_op1 / s_ul_s_op2) || (ui_l_op1 / s_ul_s_op2 != ui_l_op1 / s_f_s_op2) || (ui_l_op1 / s_f_s_op2 != ui_l_op1 / s_d_s_op2) || ((decimal)(ui_l_op1 / s_d_s_op2) != ui_l_op1 / s_m_s_op2) || (ui_l_op1 / s_m_s_op2 != ui_l_op1 / s_i_s_op2) || (ui_l_op1 / s_i_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_i_s_op2 != s_ui_s_op1 / s_ui_s_op2) || (s_ui_s_op1 / s_ui_s_op2 != s_ui_s_op1 / s_l_s_op2) || ((ulong)(s_ui_s_op1 / s_l_s_op2) != s_ui_s_op1 / s_ul_s_op2) || (s_ui_s_op1 / s_ul_s_op2 != s_ui_s_op1 / s_f_s_op2) || (s_ui_s_op1 / s_f_s_op2 != s_ui_s_op1 / s_d_s_op2) || ((decimal)(s_ui_s_op1 / s_d_s_op2) != s_ui_s_op1 / s_m_s_op2) || (s_ui_s_op1 / s_m_s_op2 != s_ui_s_op1 / s_i_s_op2) || (s_ui_s_op1 / s_i_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_i_s_op2 != l_l_op1 / s_ui_s_op2) || (l_l_op1 / s_ui_s_op2 != l_l_op1 / s_l_s_op2) || (l_l_op1 / s_l_s_op2 != l_l_op1 / (long)s_ul_s_op2) || (l_l_op1 / (long)s_ul_s_op2 != l_l_op1 / s_f_s_op2) || (l_l_op1 / s_f_s_op2 != l_l_op1 / s_d_s_op2) || ((decimal)(l_l_op1 / s_d_s_op2) != l_l_op1 / s_m_s_op2) || (l_l_op1 / s_m_s_op2 != l_l_op1 / s_i_s_op2) || (l_l_op1 / s_i_s_op2 != 32))
|
||||
{
|
||||
Console.WriteLine("testcase 10 failed");
|
||||
passed = false;
|
||||
}
|
||||
if ((s_l_s_op1 / i_l_op2 != s_l_s_op1 / ui_l_op2) || (s_l_s_op1 / ui_l_op2 != s_l_s_op1 / l_l_op2) || (s_l_s_op1 / l_l_op2 != s_l_s_op1 / (long)ul_l_op2) || (s_l_s_op1 / (long)ul_l_op2 != s_l_s_op1 / f_l_op2) || (s_l_s_op1 / f_l_op2 != s_l_s_op1 / d_l_op2) || ((decimal)(s_l_s_op1 / d_l_op2) != s_l_s_op1 / m_l_op2) || (s_l_s_op1 / m_l_op2 != s_l_s_op1 / i_l_op2) || (s_l_s_op1 / i_l_op2 != 32))
|
||||
{
|
||||
Console.WriteLine("testcase 11 failed");
|
||||
passed = false;
|
||||
}
|
||||
if ((s_l_s_op1 / s_i_s_op2 != s_l_s_op1 / s_ui_s_op2) || (s_l_s_op1 / s_ui_s_op2 != s_l_s_op1 / s_l_s_op2) || (s_l_s_op1 / s_l_s_op2 != s_l_s_op1 / (long)s_ul_s_op2) || (s_l_s_op1 / (long)s_ul_s_op2 != s_l_s_op1 / s_f_s_op2) || (s_l_s_op1 / s_f_s_op2 != s_l_s_op1 / s_d_s_op2) || ((decimal)(s_l_s_op1 / s_d_s_op2) != s_l_s_op1 / s_m_s_op2) || (s_l_s_op1 / s_m_s_op2 != s_l_s_op1 / s_i_s_op2) || (s_l_s_op1 / s_i_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_i_s_op2 != ul_l_op1 / s_ui_s_op2) || (ul_l_op1 / s_ui_s_op2 != ul_l_op1 / (ulong)s_l_s_op2) || (ul_l_op1 / (ulong)s_l_s_op2 != ul_l_op1 / s_ul_s_op2) || (ul_l_op1 / s_ul_s_op2 != ul_l_op1 / s_f_s_op2) || (ul_l_op1 / s_f_s_op2 != ul_l_op1 / s_d_s_op2) || ((decimal)(ul_l_op1 / s_d_s_op2) != ul_l_op1 / s_m_s_op2) || (ul_l_op1 / s_m_s_op2 != ul_l_op1 / (ulong)s_i_s_op2) || (ul_l_op1 / (ulong)s_i_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_i_s_op2 != s_ul_s_op1 / s_ui_s_op2) || (s_ul_s_op1 / s_ui_s_op2 != s_ul_s_op1 / (ulong)s_l_s_op2) || (s_ul_s_op1 / (ulong)s_l_s_op2 != s_ul_s_op1 / s_ul_s_op2) || (s_ul_s_op1 / s_ul_s_op2 != s_ul_s_op1 / s_f_s_op2) || (s_ul_s_op1 / s_f_s_op2 != s_ul_s_op1 / s_d_s_op2) || ((decimal)(s_ul_s_op1 / s_d_s_op2) != s_ul_s_op1 / s_m_s_op2) || (s_ul_s_op1 / s_m_s_op2 != s_ul_s_op1 / (ulong)s_i_s_op2) || (s_ul_s_op1 / (ulong)s_i_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_i_s_op2 != f_l_op1 / s_ui_s_op2) || (f_l_op1 / s_ui_s_op2 != f_l_op1 / s_l_s_op2) || (f_l_op1 / s_l_s_op2 != f_l_op1 / s_ul_s_op2) || (f_l_op1 / s_ul_s_op2 != f_l_op1 / s_f_s_op2) || (f_l_op1 / s_f_s_op2 != f_l_op1 / s_d_s_op2) || (f_l_op1 / s_d_s_op2 != f_l_op1 / (float)s_m_s_op2) || (f_l_op1 / (float)s_m_s_op2 != f_l_op1 / s_i_s_op2) || (f_l_op1 / s_i_s_op2 != 32))
|
||||
{
|
||||
Console.WriteLine("testcase 18 failed");
|
||||
passed = false;
|
||||
}
|
||||
if ((s_f_s_op1 / i_l_op2 != s_f_s_op1 / ui_l_op2) || (s_f_s_op1 / ui_l_op2 != s_f_s_op1 / l_l_op2) || (s_f_s_op1 / l_l_op2 != s_f_s_op1 / ul_l_op2) || (s_f_s_op1 / ul_l_op2 != s_f_s_op1 / f_l_op2) || (s_f_s_op1 / f_l_op2 != s_f_s_op1 / d_l_op2) || (s_f_s_op1 / d_l_op2 != s_f_s_op1 / (float)m_l_op2) || (s_f_s_op1 / (float)m_l_op2 != s_f_s_op1 / i_l_op2) || (s_f_s_op1 / i_l_op2 != 32))
|
||||
{
|
||||
Console.WriteLine("testcase 19 failed");
|
||||
passed = false;
|
||||
}
|
||||
if ((s_f_s_op1 / s_i_s_op2 != s_f_s_op1 / s_ui_s_op2) || (s_f_s_op1 / s_ui_s_op2 != s_f_s_op1 / s_l_s_op2) || (s_f_s_op1 / s_l_s_op2 != s_f_s_op1 / s_ul_s_op2) || (s_f_s_op1 / s_ul_s_op2 != s_f_s_op1 / s_f_s_op2) || (s_f_s_op1 / s_f_s_op2 != s_f_s_op1 / s_d_s_op2) || (s_f_s_op1 / s_d_s_op2 != s_f_s_op1 / (float)s_m_s_op2) || (s_f_s_op1 / (float)s_m_s_op2 != s_f_s_op1 / s_i_s_op2) || (s_f_s_op1 / s_i_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_i_s_op2 != d_l_op1 / s_ui_s_op2) || (d_l_op1 / s_ui_s_op2 != d_l_op1 / s_l_s_op2) || (d_l_op1 / s_l_s_op2 != d_l_op1 / s_ul_s_op2) || (d_l_op1 / s_ul_s_op2 != d_l_op1 / s_f_s_op2) || (d_l_op1 / s_f_s_op2 != d_l_op1 / s_d_s_op2) || (d_l_op1 / s_d_s_op2 != d_l_op1 / (double)s_m_s_op2) || (d_l_op1 / (double)s_m_s_op2 != d_l_op1 / s_i_s_op2) || (d_l_op1 / s_i_s_op2 != 32))
|
||||
{
|
||||
Console.WriteLine("testcase 22 failed");
|
||||
passed = false;
|
||||
}
|
||||
if ((s_d_s_op1 / i_l_op2 != s_d_s_op1 / ui_l_op2) || (s_d_s_op1 / ui_l_op2 != s_d_s_op1 / l_l_op2) || (s_d_s_op1 / l_l_op2 != s_d_s_op1 / ul_l_op2) || (s_d_s_op1 / ul_l_op2 != s_d_s_op1 / f_l_op2) || (s_d_s_op1 / f_l_op2 != s_d_s_op1 / d_l_op2) || (s_d_s_op1 / d_l_op2 != s_d_s_op1 / (double)m_l_op2) || (s_d_s_op1 / (double)m_l_op2 != s_d_s_op1 / i_l_op2) || (s_d_s_op1 / i_l_op2 != 32))
|
||||
{
|
||||
Console.WriteLine("testcase 23 failed");
|
||||
passed = false;
|
||||
}
|
||||
if ((s_d_s_op1 / s_i_s_op2 != s_d_s_op1 / s_ui_s_op2) || (s_d_s_op1 / s_ui_s_op2 != s_d_s_op1 / s_l_s_op2) || (s_d_s_op1 / s_l_s_op2 != s_d_s_op1 / s_ul_s_op2) || (s_d_s_op1 / s_ul_s_op2 != s_d_s_op1 / s_f_s_op2) || (s_d_s_op1 / s_f_s_op2 != s_d_s_op1 / s_d_s_op2) || (s_d_s_op1 / s_d_s_op2 != s_d_s_op1 / (double)s_m_s_op2) || (s_d_s_op1 / (double)s_m_s_op2 != s_d_s_op1 / s_i_s_op2) || (s_d_s_op1 / s_i_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_i_s_op2 != m_l_op1 / s_ui_s_op2) || (m_l_op1 / s_ui_s_op2 != m_l_op1 / s_l_s_op2) || (m_l_op1 / s_l_s_op2 != m_l_op1 / s_ul_s_op2) || (m_l_op1 / s_ul_s_op2 != m_l_op1 / (decimal)s_f_s_op2) || (m_l_op1 / (decimal)s_f_s_op2 != m_l_op1 / (decimal)s_d_s_op2) || (m_l_op1 / (decimal)s_d_s_op2 != m_l_op1 / s_m_s_op2) || (m_l_op1 / s_m_s_op2 != m_l_op1 / s_i_s_op2) || (m_l_op1 / s_i_s_op2 != 32))
|
||||
{
|
||||
Console.WriteLine("testcase 26 failed");
|
||||
passed = false;
|
||||
}
|
||||
if ((s_m_s_op1 / i_l_op2 != s_m_s_op1 / ui_l_op2) || (s_m_s_op1 / ui_l_op2 != s_m_s_op1 / l_l_op2) || (s_m_s_op1 / l_l_op2 != s_m_s_op1 / ul_l_op2) || (s_m_s_op1 / ul_l_op2 != s_m_s_op1 / (decimal)f_l_op2) || (s_m_s_op1 / (decimal)f_l_op2 != s_m_s_op1 / (decimal)d_l_op2) || (s_m_s_op1 / (decimal)d_l_op2 != s_m_s_op1 / m_l_op2) || (s_m_s_op1 / m_l_op2 != s_m_s_op1 / i_l_op2) || (s_m_s_op1 / i_l_op2 != 32))
|
||||
{
|
||||
Console.WriteLine("testcase 27 failed");
|
||||
passed = false;
|
||||
}
|
||||
if ((s_m_s_op1 / s_i_s_op2 != s_m_s_op1 / s_ui_s_op2) || (s_m_s_op1 / s_ui_s_op2 != s_m_s_op1 / s_l_s_op2) || (s_m_s_op1 / s_l_s_op2 != s_m_s_op1 / s_ul_s_op2) || (s_m_s_op1 / s_ul_s_op2 != s_m_s_op1 / (decimal)s_f_s_op2) || (s_m_s_op1 / (decimal)s_f_s_op2 != s_m_s_op1 / (decimal)s_d_s_op2) || (s_m_s_op1 / (decimal)s_d_s_op2 != s_m_s_op1 / s_m_s_op2) || (s_m_s_op1 / s_m_s_op2 != s_m_s_op1 / s_i_s_op2) || (s_m_s_op1 / s_i_s_op2 != 32))
|
||||
{
|
||||
Console.WriteLine("testcase 28 failed");
|
||||
passed = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!passed)
|
||||
{
|
||||
Console.WriteLine("FAILED");
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("PASSED");
|
||||
return 100;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,558 @@
|
|||
// 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 _i_num;
|
||||
private uint _ui_num;
|
||||
private long _l_num;
|
||||
private ulong _ul_num;
|
||||
private float _f_num;
|
||||
private double _d_num;
|
||||
private decimal _m_num;
|
||||
public numHolder(int i_num)
|
||||
{
|
||||
_i_num = Convert.ToInt32(i_num);
|
||||
_ui_num = Convert.ToUInt32(i_num);
|
||||
_l_num = Convert.ToInt64(i_num);
|
||||
_ul_num = Convert.ToUInt64(i_num);
|
||||
_f_num = Convert.ToSingle(i_num);
|
||||
_d_num = Convert.ToDouble(i_num);
|
||||
_m_num = Convert.ToDecimal(i_num);
|
||||
}
|
||||
|
||||
public static int operator *(numHolder a, int b)
|
||||
{
|
||||
return a._i_num * b;
|
||||
}
|
||||
|
||||
public numHolder(uint ui_num)
|
||||
{
|
||||
_i_num = Convert.ToInt32(ui_num);
|
||||
_ui_num = Convert.ToUInt32(ui_num);
|
||||
_l_num = Convert.ToInt64(ui_num);
|
||||
_ul_num = Convert.ToUInt64(ui_num);
|
||||
_f_num = Convert.ToSingle(ui_num);
|
||||
_d_num = Convert.ToDouble(ui_num);
|
||||
_m_num = Convert.ToDecimal(ui_num);
|
||||
}
|
||||
|
||||
public static uint operator *(numHolder a, uint b)
|
||||
{
|
||||
return a._ui_num * b;
|
||||
}
|
||||
|
||||
public numHolder(long l_num)
|
||||
{
|
||||
_i_num = Convert.ToInt32(l_num);
|
||||
_ui_num = Convert.ToUInt32(l_num);
|
||||
_l_num = Convert.ToInt64(l_num);
|
||||
_ul_num = Convert.ToUInt64(l_num);
|
||||
_f_num = Convert.ToSingle(l_num);
|
||||
_d_num = Convert.ToDouble(l_num);
|
||||
_m_num = Convert.ToDecimal(l_num);
|
||||
}
|
||||
|
||||
public static long operator *(numHolder a, long b)
|
||||
{
|
||||
return a._l_num * b;
|
||||
}
|
||||
|
||||
public numHolder(ulong ul_num)
|
||||
{
|
||||
_i_num = Convert.ToInt32(ul_num);
|
||||
_ui_num = Convert.ToUInt32(ul_num);
|
||||
_l_num = Convert.ToInt64(ul_num);
|
||||
_ul_num = Convert.ToUInt64(ul_num);
|
||||
_f_num = Convert.ToSingle(ul_num);
|
||||
_d_num = Convert.ToDouble(ul_num);
|
||||
_m_num = Convert.ToDecimal(ul_num);
|
||||
}
|
||||
|
||||
public static long operator *(numHolder a, ulong b)
|
||||
{
|
||||
return (long)(a._ul_num * b);
|
||||
}
|
||||
|
||||
public numHolder(float f_num)
|
||||
{
|
||||
_i_num = Convert.ToInt32(f_num);
|
||||
_ui_num = Convert.ToUInt32(f_num);
|
||||
_l_num = Convert.ToInt64(f_num);
|
||||
_ul_num = Convert.ToUInt64(f_num);
|
||||
_f_num = Convert.ToSingle(f_num);
|
||||
_d_num = Convert.ToDouble(f_num);
|
||||
_m_num = Convert.ToDecimal(f_num);
|
||||
}
|
||||
|
||||
public static float operator *(numHolder a, float b)
|
||||
{
|
||||
return a._f_num * b;
|
||||
}
|
||||
|
||||
public numHolder(double d_num)
|
||||
{
|
||||
_i_num = Convert.ToInt32(d_num);
|
||||
_ui_num = Convert.ToUInt32(d_num);
|
||||
_l_num = Convert.ToInt64(d_num);
|
||||
_ul_num = Convert.ToUInt64(d_num);
|
||||
_f_num = Convert.ToSingle(d_num);
|
||||
_d_num = Convert.ToDouble(d_num);
|
||||
_m_num = Convert.ToDecimal(d_num);
|
||||
}
|
||||
|
||||
public static double operator *(numHolder a, double b)
|
||||
{
|
||||
return a._d_num * b;
|
||||
}
|
||||
|
||||
public numHolder(decimal m_num)
|
||||
{
|
||||
_i_num = Convert.ToInt32(m_num);
|
||||
_ui_num = Convert.ToUInt32(m_num);
|
||||
_l_num = Convert.ToInt64(m_num);
|
||||
_ul_num = Convert.ToUInt64(m_num);
|
||||
_f_num = Convert.ToSingle(m_num);
|
||||
_d_num = Convert.ToDouble(m_num);
|
||||
_m_num = Convert.ToDecimal(m_num);
|
||||
}
|
||||
|
||||
public static int operator *(numHolder a, decimal b)
|
||||
{
|
||||
return (int)(a._m_num * b);
|
||||
}
|
||||
|
||||
public static int operator *(numHolder a, numHolder b)
|
||||
{
|
||||
return a._i_num * b._i_num;
|
||||
}
|
||||
}
|
||||
|
||||
private static int s_i_s_op1 = 3;
|
||||
private static uint s_ui_s_op1 = 3;
|
||||
private static long s_l_s_op1 = 3;
|
||||
private static ulong s_ul_s_op1 = 3;
|
||||
private static float s_f_s_op1 = 3;
|
||||
private static double s_d_s_op1 = 3;
|
||||
private static decimal s_m_s_op1 = 3;
|
||||
|
||||
private static int s_i_s_op2 = 7;
|
||||
private static uint s_ui_s_op2 = 7;
|
||||
private static long s_l_s_op2 = 7;
|
||||
private static ulong s_ul_s_op2 = 7;
|
||||
private static float s_f_s_op2 = 7;
|
||||
private static double s_d_s_op2 = 7;
|
||||
private static decimal s_m_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_i_s_op2 != i_l_op1 * s_ui_s_op2) || (i_l_op1 * s_ui_s_op2 != i_l_op1 * s_l_s_op2) || (i_l_op1 * s_l_s_op2 != i_l_op1 * (int)s_ul_s_op2) || (i_l_op1 * (int)s_ul_s_op2 != i_l_op1 * s_f_s_op2) || (i_l_op1 * s_f_s_op2 != i_l_op1 * s_d_s_op2) || ((decimal)(i_l_op1 * s_d_s_op2) != i_l_op1 * s_m_s_op2) || (i_l_op1 * s_m_s_op2 != i_l_op1 * s_i_s_op2) || (i_l_op1 * s_i_s_op2 != 21))
|
||||
{
|
||||
Console.WriteLine("testcase 2 failed");
|
||||
passed = false;
|
||||
}
|
||||
if ((s_i_s_op1 * i_l_op2 != s_i_s_op1 * ui_l_op2) || (s_i_s_op1 * ui_l_op2 != s_i_s_op1 * l_l_op2) || (s_i_s_op1 * l_l_op2 != s_i_s_op1 * (int)ul_l_op2) || (s_i_s_op1 * (int)ul_l_op2 != s_i_s_op1 * f_l_op2) || (s_i_s_op1 * f_l_op2 != s_i_s_op1 * d_l_op2) || ((decimal)(s_i_s_op1 * d_l_op2) != s_i_s_op1 * m_l_op2) || (s_i_s_op1 * m_l_op2 != s_i_s_op1 * i_l_op2) || (s_i_s_op1 * i_l_op2 != 21))
|
||||
{
|
||||
Console.WriteLine("testcase 3 failed");
|
||||
passed = false;
|
||||
}
|
||||
if ((s_i_s_op1 * s_i_s_op2 != s_i_s_op1 * s_ui_s_op2) || (s_i_s_op1 * s_ui_s_op2 != s_i_s_op1 * s_l_s_op2) || (s_i_s_op1 * s_l_s_op2 != s_i_s_op1 * (int)s_ul_s_op2) || (s_i_s_op1 * (int)s_ul_s_op2 != s_i_s_op1 * s_f_s_op2) || (s_i_s_op1 * s_f_s_op2 != s_i_s_op1 * s_d_s_op2) || ((decimal)(s_i_s_op1 * s_d_s_op2) != s_i_s_op1 * s_m_s_op2) || (s_i_s_op1 * s_m_s_op2 != s_i_s_op1 * s_i_s_op2) || (s_i_s_op1 * s_i_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_i_s_op2 != ui_l_op1 * s_ui_s_op2) || (ui_l_op1 * s_ui_s_op2 != ui_l_op1 * s_l_s_op2) || ((ulong)(ui_l_op1 * s_l_s_op2) != ui_l_op1 * s_ul_s_op2) || (ui_l_op1 * s_ul_s_op2 != ui_l_op1 * s_f_s_op2) || (ui_l_op1 * s_f_s_op2 != ui_l_op1 * s_d_s_op2) || ((decimal)(ui_l_op1 * s_d_s_op2) != ui_l_op1 * s_m_s_op2) || (ui_l_op1 * s_m_s_op2 != ui_l_op1 * s_i_s_op2) || (ui_l_op1 * s_i_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_i_s_op2 != s_ui_s_op1 * s_ui_s_op2) || (s_ui_s_op1 * s_ui_s_op2 != s_ui_s_op1 * s_l_s_op2) || ((ulong)(s_ui_s_op1 * s_l_s_op2) != s_ui_s_op1 * s_ul_s_op2) || (s_ui_s_op1 * s_ul_s_op2 != s_ui_s_op1 * s_f_s_op2) || (s_ui_s_op1 * s_f_s_op2 != s_ui_s_op1 * s_d_s_op2) || ((decimal)(s_ui_s_op1 * s_d_s_op2) != s_ui_s_op1 * s_m_s_op2) || (s_ui_s_op1 * s_m_s_op2 != s_ui_s_op1 * s_i_s_op2) || (s_ui_s_op1 * s_i_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_i_s_op2 != l_l_op1 * s_ui_s_op2) || (l_l_op1 * s_ui_s_op2 != l_l_op1 * s_l_s_op2) || (l_l_op1 * s_l_s_op2 != l_l_op1 * (long)s_ul_s_op2) || (l_l_op1 * (long)s_ul_s_op2 != l_l_op1 * s_f_s_op2) || (l_l_op1 * s_f_s_op2 != l_l_op1 * s_d_s_op2) || ((decimal)(l_l_op1 * s_d_s_op2) != l_l_op1 * s_m_s_op2) || (l_l_op1 * s_m_s_op2 != l_l_op1 * s_i_s_op2) || (l_l_op1 * s_i_s_op2 != 21))
|
||||
{
|
||||
Console.WriteLine("testcase 10 failed");
|
||||
passed = false;
|
||||
}
|
||||
if ((s_l_s_op1 * i_l_op2 != s_l_s_op1 * ui_l_op2) || (s_l_s_op1 * ui_l_op2 != s_l_s_op1 * l_l_op2) || (s_l_s_op1 * l_l_op2 != s_l_s_op1 * (long)ul_l_op2) || (s_l_s_op1 * (long)ul_l_op2 != s_l_s_op1 * f_l_op2) || (s_l_s_op1 * f_l_op2 != s_l_s_op1 * d_l_op2) || ((decimal)(s_l_s_op1 * d_l_op2) != s_l_s_op1 * m_l_op2) || (s_l_s_op1 * m_l_op2 != s_l_s_op1 * i_l_op2) || (s_l_s_op1 * i_l_op2 != 21))
|
||||
{
|
||||
Console.WriteLine("testcase 11 failed");
|
||||
passed = false;
|
||||
}
|
||||
if ((s_l_s_op1 * s_i_s_op2 != s_l_s_op1 * s_ui_s_op2) || (s_l_s_op1 * s_ui_s_op2 != s_l_s_op1 * s_l_s_op2) || (s_l_s_op1 * s_l_s_op2 != s_l_s_op1 * (long)s_ul_s_op2) || (s_l_s_op1 * (long)s_ul_s_op2 != s_l_s_op1 * s_f_s_op2) || (s_l_s_op1 * s_f_s_op2 != s_l_s_op1 * s_d_s_op2) || ((decimal)(s_l_s_op1 * s_d_s_op2) != s_l_s_op1 * s_m_s_op2) || (s_l_s_op1 * s_m_s_op2 != s_l_s_op1 * s_i_s_op2) || (s_l_s_op1 * s_i_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_i_s_op2 != ul_l_op1 * s_ui_s_op2) || (ul_l_op1 * s_ui_s_op2 != ul_l_op1 * (ulong)s_l_s_op2) || (ul_l_op1 * (ulong)s_l_s_op2 != ul_l_op1 * s_ul_s_op2) || (ul_l_op1 * s_ul_s_op2 != ul_l_op1 * s_f_s_op2) || (ul_l_op1 * s_f_s_op2 != ul_l_op1 * s_d_s_op2) || ((decimal)(ul_l_op1 * s_d_s_op2) != ul_l_op1 * s_m_s_op2) || (ul_l_op1 * s_m_s_op2 != ul_l_op1 * (ulong)s_i_s_op2) || (ul_l_op1 * (ulong)s_i_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_i_s_op2 != s_ul_s_op1 * s_ui_s_op2) || (s_ul_s_op1 * s_ui_s_op2 != s_ul_s_op1 * (ulong)s_l_s_op2) || (s_ul_s_op1 * (ulong)s_l_s_op2 != s_ul_s_op1 * s_ul_s_op2) || (s_ul_s_op1 * s_ul_s_op2 != s_ul_s_op1 * s_f_s_op2) || (s_ul_s_op1 * s_f_s_op2 != s_ul_s_op1 * s_d_s_op2) || ((decimal)(s_ul_s_op1 * s_d_s_op2) != s_ul_s_op1 * s_m_s_op2) || (s_ul_s_op1 * s_m_s_op2 != s_ul_s_op1 * (ulong)s_i_s_op2) || (s_ul_s_op1 * (ulong)s_i_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_i_s_op2 != f_l_op1 * s_ui_s_op2) || (f_l_op1 * s_ui_s_op2 != f_l_op1 * s_l_s_op2) || (f_l_op1 * s_l_s_op2 != f_l_op1 * s_ul_s_op2) || (f_l_op1 * s_ul_s_op2 != f_l_op1 * s_f_s_op2) || (f_l_op1 * s_f_s_op2 != f_l_op1 * s_d_s_op2) || (f_l_op1 * s_d_s_op2 != f_l_op1 * (float)s_m_s_op2) || (f_l_op1 * (float)s_m_s_op2 != f_l_op1 * s_i_s_op2) || (f_l_op1 * s_i_s_op2 != 21))
|
||||
{
|
||||
Console.WriteLine("testcase 18 failed");
|
||||
passed = false;
|
||||
}
|
||||
if ((s_f_s_op1 * i_l_op2 != s_f_s_op1 * ui_l_op2) || (s_f_s_op1 * ui_l_op2 != s_f_s_op1 * l_l_op2) || (s_f_s_op1 * l_l_op2 != s_f_s_op1 * ul_l_op2) || (s_f_s_op1 * ul_l_op2 != s_f_s_op1 * f_l_op2) || (s_f_s_op1 * f_l_op2 != s_f_s_op1 * d_l_op2) || (s_f_s_op1 * d_l_op2 != s_f_s_op1 * (float)m_l_op2) || (s_f_s_op1 * (float)m_l_op2 != s_f_s_op1 * i_l_op2) || (s_f_s_op1 * i_l_op2 != 21))
|
||||
{
|
||||
Console.WriteLine("testcase 19 failed");
|
||||
passed = false;
|
||||
}
|
||||
if ((s_f_s_op1 * s_i_s_op2 != s_f_s_op1 * s_ui_s_op2) || (s_f_s_op1 * s_ui_s_op2 != s_f_s_op1 * s_l_s_op2) || (s_f_s_op1 * s_l_s_op2 != s_f_s_op1 * s_ul_s_op2) || (s_f_s_op1 * s_ul_s_op2 != s_f_s_op1 * s_f_s_op2) || (s_f_s_op1 * s_f_s_op2 != s_f_s_op1 * s_d_s_op2) || (s_f_s_op1 * s_d_s_op2 != s_f_s_op1 * (float)s_m_s_op2) || (s_f_s_op1 * (float)s_m_s_op2 != s_f_s_op1 * s_i_s_op2) || (s_f_s_op1 * s_i_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_i_s_op2 != d_l_op1 * s_ui_s_op2) || (d_l_op1 * s_ui_s_op2 != d_l_op1 * s_l_s_op2) || (d_l_op1 * s_l_s_op2 != d_l_op1 * s_ul_s_op2) || (d_l_op1 * s_ul_s_op2 != d_l_op1 * s_f_s_op2) || (d_l_op1 * s_f_s_op2 != d_l_op1 * s_d_s_op2) || (d_l_op1 * s_d_s_op2 != d_l_op1 * (double)s_m_s_op2) || (d_l_op1 * (double)s_m_s_op2 != d_l_op1 * s_i_s_op2) || (d_l_op1 * s_i_s_op2 != 21))
|
||||
{
|
||||
Console.WriteLine("testcase 22 failed");
|
||||
passed = false;
|
||||
}
|
||||
if ((s_d_s_op1 * i_l_op2 != s_d_s_op1 * ui_l_op2) || (s_d_s_op1 * ui_l_op2 != s_d_s_op1 * l_l_op2) || (s_d_s_op1 * l_l_op2 != s_d_s_op1 * ul_l_op2) || (s_d_s_op1 * ul_l_op2 != s_d_s_op1 * f_l_op2) || (s_d_s_op1 * f_l_op2 != s_d_s_op1 * d_l_op2) || (s_d_s_op1 * d_l_op2 != s_d_s_op1 * (double)m_l_op2) || (s_d_s_op1 * (double)m_l_op2 != s_d_s_op1 * i_l_op2) || (s_d_s_op1 * i_l_op2 != 21))
|
||||
{
|
||||
Console.WriteLine("testcase 23 failed");
|
||||
passed = false;
|
||||
}
|
||||
if ((s_d_s_op1 * s_i_s_op2 != s_d_s_op1 * s_ui_s_op2) || (s_d_s_op1 * s_ui_s_op2 != s_d_s_op1 * s_l_s_op2) || (s_d_s_op1 * s_l_s_op2 != s_d_s_op1 * s_ul_s_op2) || (s_d_s_op1 * s_ul_s_op2 != s_d_s_op1 * s_f_s_op2) || (s_d_s_op1 * s_f_s_op2 != s_d_s_op1 * s_d_s_op2) || (s_d_s_op1 * s_d_s_op2 != s_d_s_op1 * (double)s_m_s_op2) || (s_d_s_op1 * (double)s_m_s_op2 != s_d_s_op1 * s_i_s_op2) || (s_d_s_op1 * s_i_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_i_s_op2 != m_l_op1 * s_ui_s_op2) || (m_l_op1 * s_ui_s_op2 != m_l_op1 * s_l_s_op2) || (m_l_op1 * s_l_s_op2 != m_l_op1 * s_ul_s_op2) || (m_l_op1 * s_ul_s_op2 != m_l_op1 * (decimal)s_f_s_op2) || (m_l_op1 * (decimal)s_f_s_op2 != m_l_op1 * (decimal)s_d_s_op2) || (m_l_op1 * (decimal)s_d_s_op2 != m_l_op1 * s_m_s_op2) || (m_l_op1 * s_m_s_op2 != m_l_op1 * s_i_s_op2) || (m_l_op1 * s_i_s_op2 != 21))
|
||||
{
|
||||
Console.WriteLine("testcase 26 failed");
|
||||
passed = false;
|
||||
}
|
||||
if ((s_m_s_op1 * i_l_op2 != s_m_s_op1 * ui_l_op2) || (s_m_s_op1 * ui_l_op2 != s_m_s_op1 * l_l_op2) || (s_m_s_op1 * l_l_op2 != s_m_s_op1 * ul_l_op2) || (s_m_s_op1 * ul_l_op2 != s_m_s_op1 * (decimal)f_l_op2) || (s_m_s_op1 * (decimal)f_l_op2 != s_m_s_op1 * (decimal)d_l_op2) || (s_m_s_op1 * (decimal)d_l_op2 != s_m_s_op1 * m_l_op2) || (s_m_s_op1 * m_l_op2 != s_m_s_op1 * i_l_op2) || (s_m_s_op1 * i_l_op2 != 21))
|
||||
{
|
||||
Console.WriteLine("testcase 27 failed");
|
||||
passed = false;
|
||||
}
|
||||
if ((s_m_s_op1 * s_i_s_op2 != s_m_s_op1 * s_ui_s_op2) || (s_m_s_op1 * s_ui_s_op2 != s_m_s_op1 * s_l_s_op2) || (s_m_s_op1 * s_l_s_op2 != s_m_s_op1 * s_ul_s_op2) || (s_m_s_op1 * s_ul_s_op2 != s_m_s_op1 * (decimal)s_f_s_op2) || (s_m_s_op1 * (decimal)s_f_s_op2 != s_m_s_op1 * (decimal)s_d_s_op2) || (s_m_s_op1 * (decimal)s_d_s_op2 != s_m_s_op1 * s_m_s_op2) || (s_m_s_op1 * s_m_s_op2 != s_m_s_op1 * s_i_s_op2) || (s_m_s_op1 * s_i_s_op2 != 21))
|
||||
{
|
||||
Console.WriteLine("testcase 28 failed");
|
||||
passed = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!passed)
|
||||
{
|
||||
Console.WriteLine("FAILED");
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("PASSED");
|
||||
return 100;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,558 @@
|
|||
// 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 _i_num;
|
||||
private uint _ui_num;
|
||||
private long _l_num;
|
||||
private ulong _ul_num;
|
||||
private float _f_num;
|
||||
private double _d_num;
|
||||
private decimal _m_num;
|
||||
public numHolder(int i_num)
|
||||
{
|
||||
_i_num = Convert.ToInt32(i_num);
|
||||
_ui_num = Convert.ToUInt32(i_num);
|
||||
_l_num = Convert.ToInt64(i_num);
|
||||
_ul_num = Convert.ToUInt64(i_num);
|
||||
_f_num = Convert.ToSingle(i_num);
|
||||
_d_num = Convert.ToDouble(i_num);
|
||||
_m_num = Convert.ToDecimal(i_num);
|
||||
}
|
||||
|
||||
public static int operator %(numHolder a, int b)
|
||||
{
|
||||
return a._i_num % b;
|
||||
}
|
||||
|
||||
public numHolder(uint ui_num)
|
||||
{
|
||||
_i_num = Convert.ToInt32(ui_num);
|
||||
_ui_num = Convert.ToUInt32(ui_num);
|
||||
_l_num = Convert.ToInt64(ui_num);
|
||||
_ul_num = Convert.ToUInt64(ui_num);
|
||||
_f_num = Convert.ToSingle(ui_num);
|
||||
_d_num = Convert.ToDouble(ui_num);
|
||||
_m_num = Convert.ToDecimal(ui_num);
|
||||
}
|
||||
|
||||
public static uint operator %(numHolder a, uint b)
|
||||
{
|
||||
return a._ui_num % b;
|
||||
}
|
||||
|
||||
public numHolder(long l_num)
|
||||
{
|
||||
_i_num = Convert.ToInt32(l_num);
|
||||
_ui_num = Convert.ToUInt32(l_num);
|
||||
_l_num = Convert.ToInt64(l_num);
|
||||
_ul_num = Convert.ToUInt64(l_num);
|
||||
_f_num = Convert.ToSingle(l_num);
|
||||
_d_num = Convert.ToDouble(l_num);
|
||||
_m_num = Convert.ToDecimal(l_num);
|
||||
}
|
||||
|
||||
public static long operator %(numHolder a, long b)
|
||||
{
|
||||
return a._l_num % b;
|
||||
}
|
||||
|
||||
public numHolder(ulong ul_num)
|
||||
{
|
||||
_i_num = Convert.ToInt32(ul_num);
|
||||
_ui_num = Convert.ToUInt32(ul_num);
|
||||
_l_num = Convert.ToInt64(ul_num);
|
||||
_ul_num = Convert.ToUInt64(ul_num);
|
||||
_f_num = Convert.ToSingle(ul_num);
|
||||
_d_num = Convert.ToDouble(ul_num);
|
||||
_m_num = Convert.ToDecimal(ul_num);
|
||||
}
|
||||
|
||||
public static long operator %(numHolder a, ulong b)
|
||||
{
|
||||
return (long)(a._ul_num % b);
|
||||
}
|
||||
|
||||
public numHolder(float f_num)
|
||||
{
|
||||
_i_num = Convert.ToInt32(f_num);
|
||||
_ui_num = Convert.ToUInt32(f_num);
|
||||
_l_num = Convert.ToInt64(f_num);
|
||||
_ul_num = Convert.ToUInt64(f_num);
|
||||
_f_num = Convert.ToSingle(f_num);
|
||||
_d_num = Convert.ToDouble(f_num);
|
||||
_m_num = Convert.ToDecimal(f_num);
|
||||
}
|
||||
|
||||
public static float operator %(numHolder a, float b)
|
||||
{
|
||||
return a._f_num % b;
|
||||
}
|
||||
|
||||
public numHolder(double d_num)
|
||||
{
|
||||
_i_num = Convert.ToInt32(d_num);
|
||||
_ui_num = Convert.ToUInt32(d_num);
|
||||
_l_num = Convert.ToInt64(d_num);
|
||||
_ul_num = Convert.ToUInt64(d_num);
|
||||
_f_num = Convert.ToSingle(d_num);
|
||||
_d_num = Convert.ToDouble(d_num);
|
||||
_m_num = Convert.ToDecimal(d_num);
|
||||
}
|
||||
|
||||
public static double operator %(numHolder a, double b)
|
||||
{
|
||||
return a._d_num % b;
|
||||
}
|
||||
|
||||
public numHolder(decimal m_num)
|
||||
{
|
||||
_i_num = Convert.ToInt32(m_num);
|
||||
_ui_num = Convert.ToUInt32(m_num);
|
||||
_l_num = Convert.ToInt64(m_num);
|
||||
_ul_num = Convert.ToUInt64(m_num);
|
||||
_f_num = Convert.ToSingle(m_num);
|
||||
_d_num = Convert.ToDouble(m_num);
|
||||
_m_num = Convert.ToDecimal(m_num);
|
||||
}
|
||||
|
||||
public static int operator %(numHolder a, decimal b)
|
||||
{
|
||||
return (int)(a._m_num % b);
|
||||
}
|
||||
|
||||
public static int operator %(numHolder a, numHolder b)
|
||||
{
|
||||
return a._i_num % b._i_num;
|
||||
}
|
||||
}
|
||||
|
||||
private static int s_i_s_op1 = 9;
|
||||
private static uint s_ui_s_op1 = 9;
|
||||
private static long s_l_s_op1 = 9;
|
||||
private static ulong s_ul_s_op1 = 9;
|
||||
private static float s_f_s_op1 = 9;
|
||||
private static double s_d_s_op1 = 9;
|
||||
private static decimal s_m_s_op1 = 9;
|
||||
|
||||
private static int s_i_s_op2 = 5;
|
||||
private static uint s_ui_s_op2 = 5;
|
||||
private static long s_l_s_op2 = 5;
|
||||
private static ulong s_ul_s_op2 = 5;
|
||||
private static float s_f_s_op2 = 5;
|
||||
private static double s_d_s_op2 = 5;
|
||||
private static decimal s_m_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_i_s_op2 != i_l_op1 % s_ui_s_op2) || (i_l_op1 % s_ui_s_op2 != i_l_op1 % s_l_s_op2) || (i_l_op1 % s_l_s_op2 != i_l_op1 % (int)s_ul_s_op2) || (i_l_op1 % (int)s_ul_s_op2 != i_l_op1 % s_f_s_op2) || (i_l_op1 % s_f_s_op2 != i_l_op1 % s_d_s_op2) || ((decimal)(i_l_op1 % s_d_s_op2) != i_l_op1 % s_m_s_op2) || (i_l_op1 % s_m_s_op2 != i_l_op1 % s_i_s_op2) || (i_l_op1 % s_i_s_op2 != 4))
|
||||
{
|
||||
Console.WriteLine("testcase 2 failed");
|
||||
passed = false;
|
||||
}
|
||||
if ((s_i_s_op1 % i_l_op2 != s_i_s_op1 % ui_l_op2) || (s_i_s_op1 % ui_l_op2 != s_i_s_op1 % l_l_op2) || (s_i_s_op1 % l_l_op2 != s_i_s_op1 % (int)ul_l_op2) || (s_i_s_op1 % (int)ul_l_op2 != s_i_s_op1 % f_l_op2) || (s_i_s_op1 % f_l_op2 != s_i_s_op1 % d_l_op2) || ((decimal)(s_i_s_op1 % d_l_op2) != s_i_s_op1 % m_l_op2) || (s_i_s_op1 % m_l_op2 != s_i_s_op1 % i_l_op2) || (s_i_s_op1 % i_l_op2 != 4))
|
||||
{
|
||||
Console.WriteLine("testcase 3 failed");
|
||||
passed = false;
|
||||
}
|
||||
if ((s_i_s_op1 % s_i_s_op2 != s_i_s_op1 % s_ui_s_op2) || (s_i_s_op1 % s_ui_s_op2 != s_i_s_op1 % s_l_s_op2) || (s_i_s_op1 % s_l_s_op2 != s_i_s_op1 % (int)s_ul_s_op2) || (s_i_s_op1 % (int)s_ul_s_op2 != s_i_s_op1 % s_f_s_op2) || (s_i_s_op1 % s_f_s_op2 != s_i_s_op1 % s_d_s_op2) || ((decimal)(s_i_s_op1 % s_d_s_op2) != s_i_s_op1 % s_m_s_op2) || (s_i_s_op1 % s_m_s_op2 != s_i_s_op1 % s_i_s_op2) || (s_i_s_op1 % s_i_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_i_s_op2 != ui_l_op1 % s_ui_s_op2) || (ui_l_op1 % s_ui_s_op2 != ui_l_op1 % s_l_s_op2) || ((ulong)(ui_l_op1 % s_l_s_op2) != ui_l_op1 % s_ul_s_op2) || (ui_l_op1 % s_ul_s_op2 != ui_l_op1 % s_f_s_op2) || (ui_l_op1 % s_f_s_op2 != ui_l_op1 % s_d_s_op2) || ((decimal)(ui_l_op1 % s_d_s_op2) != ui_l_op1 % s_m_s_op2) || (ui_l_op1 % s_m_s_op2 != ui_l_op1 % s_i_s_op2) || (ui_l_op1 % s_i_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_i_s_op2 != s_ui_s_op1 % s_ui_s_op2) || (s_ui_s_op1 % s_ui_s_op2 != s_ui_s_op1 % s_l_s_op2) || ((ulong)(s_ui_s_op1 % s_l_s_op2) != s_ui_s_op1 % s_ul_s_op2) || (s_ui_s_op1 % s_ul_s_op2 != s_ui_s_op1 % s_f_s_op2) || (s_ui_s_op1 % s_f_s_op2 != s_ui_s_op1 % s_d_s_op2) || ((decimal)(s_ui_s_op1 % s_d_s_op2) != s_ui_s_op1 % s_m_s_op2) || (s_ui_s_op1 % s_m_s_op2 != s_ui_s_op1 % s_i_s_op2) || (s_ui_s_op1 % s_i_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_i_s_op2 != l_l_op1 % s_ui_s_op2) || (l_l_op1 % s_ui_s_op2 != l_l_op1 % s_l_s_op2) || (l_l_op1 % s_l_s_op2 != l_l_op1 % (long)s_ul_s_op2) || (l_l_op1 % (long)s_ul_s_op2 != l_l_op1 % s_f_s_op2) || (l_l_op1 % s_f_s_op2 != l_l_op1 % s_d_s_op2) || ((decimal)(l_l_op1 % s_d_s_op2) != l_l_op1 % s_m_s_op2) || (l_l_op1 % s_m_s_op2 != l_l_op1 % s_i_s_op2) || (l_l_op1 % s_i_s_op2 != 4))
|
||||
{
|
||||
Console.WriteLine("testcase 10 failed");
|
||||
passed = false;
|
||||
}
|
||||
if ((s_l_s_op1 % i_l_op2 != s_l_s_op1 % ui_l_op2) || (s_l_s_op1 % ui_l_op2 != s_l_s_op1 % l_l_op2) || (s_l_s_op1 % l_l_op2 != s_l_s_op1 % (long)ul_l_op2) || (s_l_s_op1 % (long)ul_l_op2 != s_l_s_op1 % f_l_op2) || (s_l_s_op1 % f_l_op2 != s_l_s_op1 % d_l_op2) || ((decimal)(s_l_s_op1 % d_l_op2) != s_l_s_op1 % m_l_op2) || (s_l_s_op1 % m_l_op2 != s_l_s_op1 % i_l_op2) || (s_l_s_op1 % i_l_op2 != 4))
|
||||
{
|
||||
Console.WriteLine("testcase 11 failed");
|
||||
passed = false;
|
||||
}
|
||||
if ((s_l_s_op1 % s_i_s_op2 != s_l_s_op1 % s_ui_s_op2) || (s_l_s_op1 % s_ui_s_op2 != s_l_s_op1 % s_l_s_op2) || (s_l_s_op1 % s_l_s_op2 != s_l_s_op1 % (long)s_ul_s_op2) || (s_l_s_op1 % (long)s_ul_s_op2 != s_l_s_op1 % s_f_s_op2) || (s_l_s_op1 % s_f_s_op2 != s_l_s_op1 % s_d_s_op2) || ((decimal)(s_l_s_op1 % s_d_s_op2) != s_l_s_op1 % s_m_s_op2) || (s_l_s_op1 % s_m_s_op2 != s_l_s_op1 % s_i_s_op2) || (s_l_s_op1 % s_i_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_i_s_op2 != ul_l_op1 % s_ui_s_op2) || (ul_l_op1 % s_ui_s_op2 != ul_l_op1 % (ulong)s_l_s_op2) || (ul_l_op1 % (ulong)s_l_s_op2 != ul_l_op1 % s_ul_s_op2) || (ul_l_op1 % s_ul_s_op2 != ul_l_op1 % s_f_s_op2) || (ul_l_op1 % s_f_s_op2 != ul_l_op1 % s_d_s_op2) || ((decimal)(ul_l_op1 % s_d_s_op2) != ul_l_op1 % s_m_s_op2) || (ul_l_op1 % s_m_s_op2 != ul_l_op1 % (ulong)s_i_s_op2) || (ul_l_op1 % (ulong)s_i_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_i_s_op2 != s_ul_s_op1 % s_ui_s_op2) || (s_ul_s_op1 % s_ui_s_op2 != s_ul_s_op1 % (ulong)s_l_s_op2) || (s_ul_s_op1 % (ulong)s_l_s_op2 != s_ul_s_op1 % s_ul_s_op2) || (s_ul_s_op1 % s_ul_s_op2 != s_ul_s_op1 % s_f_s_op2) || (s_ul_s_op1 % s_f_s_op2 != s_ul_s_op1 % s_d_s_op2) || ((decimal)(s_ul_s_op1 % s_d_s_op2) != s_ul_s_op1 % s_m_s_op2) || (s_ul_s_op1 % s_m_s_op2 != s_ul_s_op1 % (ulong)s_i_s_op2) || (s_ul_s_op1 % (ulong)s_i_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_i_s_op2 != f_l_op1 % s_ui_s_op2) || (f_l_op1 % s_ui_s_op2 != f_l_op1 % s_l_s_op2) || (f_l_op1 % s_l_s_op2 != f_l_op1 % s_ul_s_op2) || (f_l_op1 % s_ul_s_op2 != f_l_op1 % s_f_s_op2) || (f_l_op1 % s_f_s_op2 != f_l_op1 % s_d_s_op2) || (f_l_op1 % s_d_s_op2 != f_l_op1 % (float)s_m_s_op2) || (f_l_op1 % (float)s_m_s_op2 != f_l_op1 % s_i_s_op2) || (f_l_op1 % s_i_s_op2 != 4))
|
||||
{
|
||||
Console.WriteLine("testcase 18 failed");
|
||||
passed = false;
|
||||
}
|
||||
if ((s_f_s_op1 % i_l_op2 != s_f_s_op1 % ui_l_op2) || (s_f_s_op1 % ui_l_op2 != s_f_s_op1 % l_l_op2) || (s_f_s_op1 % l_l_op2 != s_f_s_op1 % ul_l_op2) || (s_f_s_op1 % ul_l_op2 != s_f_s_op1 % f_l_op2) || (s_f_s_op1 % f_l_op2 != s_f_s_op1 % d_l_op2) || (s_f_s_op1 % d_l_op2 != s_f_s_op1 % (float)m_l_op2) || (s_f_s_op1 % (float)m_l_op2 != s_f_s_op1 % i_l_op2) || (s_f_s_op1 % i_l_op2 != 4))
|
||||
{
|
||||
Console.WriteLine("testcase 19 failed");
|
||||
passed = false;
|
||||
}
|
||||
if ((s_f_s_op1 % s_i_s_op2 != s_f_s_op1 % s_ui_s_op2) || (s_f_s_op1 % s_ui_s_op2 != s_f_s_op1 % s_l_s_op2) || (s_f_s_op1 % s_l_s_op2 != s_f_s_op1 % s_ul_s_op2) || (s_f_s_op1 % s_ul_s_op2 != s_f_s_op1 % s_f_s_op2) || (s_f_s_op1 % s_f_s_op2 != s_f_s_op1 % s_d_s_op2) || (s_f_s_op1 % s_d_s_op2 != s_f_s_op1 % (float)s_m_s_op2) || (s_f_s_op1 % (float)s_m_s_op2 != s_f_s_op1 % s_i_s_op2) || (s_f_s_op1 % s_i_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_i_s_op2 != d_l_op1 % s_ui_s_op2) || (d_l_op1 % s_ui_s_op2 != d_l_op1 % s_l_s_op2) || (d_l_op1 % s_l_s_op2 != d_l_op1 % s_ul_s_op2) || (d_l_op1 % s_ul_s_op2 != d_l_op1 % s_f_s_op2) || (d_l_op1 % s_f_s_op2 != d_l_op1 % s_d_s_op2) || (d_l_op1 % s_d_s_op2 != d_l_op1 % (double)s_m_s_op2) || (d_l_op1 % (double)s_m_s_op2 != d_l_op1 % s_i_s_op2) || (d_l_op1 % s_i_s_op2 != 4))
|
||||
{
|
||||
Console.WriteLine("testcase 22 failed");
|
||||
passed = false;
|
||||
}
|
||||
if ((s_d_s_op1 % i_l_op2 != s_d_s_op1 % ui_l_op2) || (s_d_s_op1 % ui_l_op2 != s_d_s_op1 % l_l_op2) || (s_d_s_op1 % l_l_op2 != s_d_s_op1 % ul_l_op2) || (s_d_s_op1 % ul_l_op2 != s_d_s_op1 % f_l_op2) || (s_d_s_op1 % f_l_op2 != s_d_s_op1 % d_l_op2) || (s_d_s_op1 % d_l_op2 != s_d_s_op1 % (double)m_l_op2) || (s_d_s_op1 % (double)m_l_op2 != s_d_s_op1 % i_l_op2) || (s_d_s_op1 % i_l_op2 != 4))
|
||||
{
|
||||
Console.WriteLine("testcase 23 failed");
|
||||
passed = false;
|
||||
}
|
||||
if ((s_d_s_op1 % s_i_s_op2 != s_d_s_op1 % s_ui_s_op2) || (s_d_s_op1 % s_ui_s_op2 != s_d_s_op1 % s_l_s_op2) || (s_d_s_op1 % s_l_s_op2 != s_d_s_op1 % s_ul_s_op2) || (s_d_s_op1 % s_ul_s_op2 != s_d_s_op1 % s_f_s_op2) || (s_d_s_op1 % s_f_s_op2 != s_d_s_op1 % s_d_s_op2) || (s_d_s_op1 % s_d_s_op2 != s_d_s_op1 % (double)s_m_s_op2) || (s_d_s_op1 % (double)s_m_s_op2 != s_d_s_op1 % s_i_s_op2) || (s_d_s_op1 % s_i_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_i_s_op2 != m_l_op1 % s_ui_s_op2) || (m_l_op1 % s_ui_s_op2 != m_l_op1 % s_l_s_op2) || (m_l_op1 % s_l_s_op2 != m_l_op1 % s_ul_s_op2) || (m_l_op1 % s_ul_s_op2 != m_l_op1 % (decimal)s_f_s_op2) || (m_l_op1 % (decimal)s_f_s_op2 != m_l_op1 % (decimal)s_d_s_op2) || (m_l_op1 % (decimal)s_d_s_op2 != m_l_op1 % s_m_s_op2) || (m_l_op1 % s_m_s_op2 != m_l_op1 % s_i_s_op2) || (m_l_op1 % s_i_s_op2 != 4))
|
||||
{
|
||||
Console.WriteLine("testcase 26 failed");
|
||||
passed = false;
|
||||
}
|
||||
if ((s_m_s_op1 % i_l_op2 != s_m_s_op1 % ui_l_op2) || (s_m_s_op1 % ui_l_op2 != s_m_s_op1 % l_l_op2) || (s_m_s_op1 % l_l_op2 != s_m_s_op1 % ul_l_op2) || (s_m_s_op1 % ul_l_op2 != s_m_s_op1 % (decimal)f_l_op2) || (s_m_s_op1 % (decimal)f_l_op2 != s_m_s_op1 % (decimal)d_l_op2) || (s_m_s_op1 % (decimal)d_l_op2 != s_m_s_op1 % m_l_op2) || (s_m_s_op1 % m_l_op2 != s_m_s_op1 % i_l_op2) || (s_m_s_op1 % i_l_op2 != 4))
|
||||
{
|
||||
Console.WriteLine("testcase 27 failed");
|
||||
passed = false;
|
||||
}
|
||||
if ((s_m_s_op1 % s_i_s_op2 != s_m_s_op1 % s_ui_s_op2) || (s_m_s_op1 % s_ui_s_op2 != s_m_s_op1 % s_l_s_op2) || (s_m_s_op1 % s_l_s_op2 != s_m_s_op1 % s_ul_s_op2) || (s_m_s_op1 % s_ul_s_op2 != s_m_s_op1 % (decimal)s_f_s_op2) || (s_m_s_op1 % (decimal)s_f_s_op2 != s_m_s_op1 % (decimal)s_d_s_op2) || (s_m_s_op1 % (decimal)s_d_s_op2 != s_m_s_op1 % s_m_s_op2) || (s_m_s_op1 % s_m_s_op2 != s_m_s_op1 % s_i_s_op2) || (s_m_s_op1 % s_i_s_op2 != 4))
|
||||
{
|
||||
Console.WriteLine("testcase 28 failed");
|
||||
passed = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!passed)
|
||||
{
|
||||
Console.WriteLine("FAILED");
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("PASSED");
|
||||
return 100;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,558 @@
|
|||
// 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 _i_num;
|
||||
private uint _ui_num;
|
||||
private long _l_num;
|
||||
private ulong _ul_num;
|
||||
private float _f_num;
|
||||
private double _d_num;
|
||||
private decimal _m_num;
|
||||
public numHolder(int i_num)
|
||||
{
|
||||
_i_num = Convert.ToInt32(i_num);
|
||||
_ui_num = Convert.ToUInt32(i_num);
|
||||
_l_num = Convert.ToInt64(i_num);
|
||||
_ul_num = Convert.ToUInt64(i_num);
|
||||
_f_num = Convert.ToSingle(i_num);
|
||||
_d_num = Convert.ToDouble(i_num);
|
||||
_m_num = Convert.ToDecimal(i_num);
|
||||
}
|
||||
|
||||
public static int operator -(numHolder a, int b)
|
||||
{
|
||||
return a._i_num - b;
|
||||
}
|
||||
|
||||
public numHolder(uint ui_num)
|
||||
{
|
||||
_i_num = Convert.ToInt32(ui_num);
|
||||
_ui_num = Convert.ToUInt32(ui_num);
|
||||
_l_num = Convert.ToInt64(ui_num);
|
||||
_ul_num = Convert.ToUInt64(ui_num);
|
||||
_f_num = Convert.ToSingle(ui_num);
|
||||
_d_num = Convert.ToDouble(ui_num);
|
||||
_m_num = Convert.ToDecimal(ui_num);
|
||||
}
|
||||
|
||||
public static uint operator -(numHolder a, uint b)
|
||||
{
|
||||
return a._ui_num - b;
|
||||
}
|
||||
|
||||
public numHolder(long l_num)
|
||||
{
|
||||
_i_num = Convert.ToInt32(l_num);
|
||||
_ui_num = Convert.ToUInt32(l_num);
|
||||
_l_num = Convert.ToInt64(l_num);
|
||||
_ul_num = Convert.ToUInt64(l_num);
|
||||
_f_num = Convert.ToSingle(l_num);
|
||||
_d_num = Convert.ToDouble(l_num);
|
||||
_m_num = Convert.ToDecimal(l_num);
|
||||
}
|
||||
|
||||
public static long operator -(numHolder a, long b)
|
||||
{
|
||||
return a._l_num - b;
|
||||
}
|
||||
|
||||
public numHolder(ulong ul_num)
|
||||
{
|
||||
_i_num = Convert.ToInt32(ul_num);
|
||||
_ui_num = Convert.ToUInt32(ul_num);
|
||||
_l_num = Convert.ToInt64(ul_num);
|
||||
_ul_num = Convert.ToUInt64(ul_num);
|
||||
_f_num = Convert.ToSingle(ul_num);
|
||||
_d_num = Convert.ToDouble(ul_num);
|
||||
_m_num = Convert.ToDecimal(ul_num);
|
||||
}
|
||||
|
||||
public static long operator -(numHolder a, ulong b)
|
||||
{
|
||||
return (long)(a._ul_num - b);
|
||||
}
|
||||
|
||||
public numHolder(float f_num)
|
||||
{
|
||||
_i_num = Convert.ToInt32(f_num);
|
||||
_ui_num = Convert.ToUInt32(f_num);
|
||||
_l_num = Convert.ToInt64(f_num);
|
||||
_ul_num = Convert.ToUInt64(f_num);
|
||||
_f_num = Convert.ToSingle(f_num);
|
||||
_d_num = Convert.ToDouble(f_num);
|
||||
_m_num = Convert.ToDecimal(f_num);
|
||||
}
|
||||
|
||||
public static float operator -(numHolder a, float b)
|
||||
{
|
||||
return a._f_num - b;
|
||||
}
|
||||
|
||||
public numHolder(double d_num)
|
||||
{
|
||||
_i_num = Convert.ToInt32(d_num);
|
||||
_ui_num = Convert.ToUInt32(d_num);
|
||||
_l_num = Convert.ToInt64(d_num);
|
||||
_ul_num = Convert.ToUInt64(d_num);
|
||||
_f_num = Convert.ToSingle(d_num);
|
||||
_d_num = Convert.ToDouble(d_num);
|
||||
_m_num = Convert.ToDecimal(d_num);
|
||||
}
|
||||
|
||||
public static double operator -(numHolder a, double b)
|
||||
{
|
||||
return a._d_num - b;
|
||||
}
|
||||
|
||||
public numHolder(decimal m_num)
|
||||
{
|
||||
_i_num = Convert.ToInt32(m_num);
|
||||
_ui_num = Convert.ToUInt32(m_num);
|
||||
_l_num = Convert.ToInt64(m_num);
|
||||
_ul_num = Convert.ToUInt64(m_num);
|
||||
_f_num = Convert.ToSingle(m_num);
|
||||
_d_num = Convert.ToDouble(m_num);
|
||||
_m_num = Convert.ToDecimal(m_num);
|
||||
}
|
||||
|
||||
public static int operator -(numHolder a, decimal b)
|
||||
{
|
||||
return (int)(a._m_num - b);
|
||||
}
|
||||
|
||||
public static int operator -(numHolder a, numHolder b)
|
||||
{
|
||||
return a._i_num - b._i_num;
|
||||
}
|
||||
}
|
||||
|
||||
private static int s_i_s_op1 = 16;
|
||||
private static uint s_ui_s_op1 = 16;
|
||||
private static long s_l_s_op1 = 16;
|
||||
private static ulong s_ul_s_op1 = 16;
|
||||
private static float s_f_s_op1 = 16;
|
||||
private static double s_d_s_op1 = 16;
|
||||
private static decimal s_m_s_op1 = 16;
|
||||
|
||||
private static int s_i_s_op2 = 15;
|
||||
private static uint s_ui_s_op2 = 15;
|
||||
private static long s_l_s_op2 = 15;
|
||||
private static ulong s_ul_s_op2 = 15;
|
||||
private static float s_f_s_op2 = 15;
|
||||
private static double s_d_s_op2 = 15;
|
||||
private static decimal s_m_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_i_s_op2 != i_l_op1 - s_ui_s_op2) || (i_l_op1 - s_ui_s_op2 != i_l_op1 - s_l_s_op2) || (i_l_op1 - s_l_s_op2 != i_l_op1 - (int)s_ul_s_op2) || (i_l_op1 - (int)s_ul_s_op2 != i_l_op1 - s_f_s_op2) || (i_l_op1 - s_f_s_op2 != i_l_op1 - s_d_s_op2) || ((decimal)(i_l_op1 - s_d_s_op2) != i_l_op1 - s_m_s_op2) || (i_l_op1 - s_m_s_op2 != i_l_op1 - s_i_s_op2) || (i_l_op1 - s_i_s_op2 != 1))
|
||||
{
|
||||
Console.WriteLine("testcase 2 failed");
|
||||
passed = false;
|
||||
}
|
||||
if ((s_i_s_op1 - i_l_op2 != s_i_s_op1 - ui_l_op2) || (s_i_s_op1 - ui_l_op2 != s_i_s_op1 - l_l_op2) || (s_i_s_op1 - l_l_op2 != s_i_s_op1 - (int)ul_l_op2) || (s_i_s_op1 - (int)ul_l_op2 != s_i_s_op1 - f_l_op2) || (s_i_s_op1 - f_l_op2 != s_i_s_op1 - d_l_op2) || ((decimal)(s_i_s_op1 - d_l_op2) != s_i_s_op1 - m_l_op2) || (s_i_s_op1 - m_l_op2 != s_i_s_op1 - i_l_op2) || (s_i_s_op1 - i_l_op2 != 1))
|
||||
{
|
||||
Console.WriteLine("testcase 3 failed");
|
||||
passed = false;
|
||||
}
|
||||
if ((s_i_s_op1 - s_i_s_op2 != s_i_s_op1 - s_ui_s_op2) || (s_i_s_op1 - s_ui_s_op2 != s_i_s_op1 - s_l_s_op2) || (s_i_s_op1 - s_l_s_op2 != s_i_s_op1 - (int)s_ul_s_op2) || (s_i_s_op1 - (int)s_ul_s_op2 != s_i_s_op1 - s_f_s_op2) || (s_i_s_op1 - s_f_s_op2 != s_i_s_op1 - s_d_s_op2) || ((decimal)(s_i_s_op1 - s_d_s_op2) != s_i_s_op1 - s_m_s_op2) || (s_i_s_op1 - s_m_s_op2 != s_i_s_op1 - s_i_s_op2) || (s_i_s_op1 - s_i_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_i_s_op2 != ui_l_op1 - s_ui_s_op2) || (ui_l_op1 - s_ui_s_op2 != ui_l_op1 - s_l_s_op2) || ((ulong)(ui_l_op1 - s_l_s_op2) != ui_l_op1 - s_ul_s_op2) || (ui_l_op1 - s_ul_s_op2 != ui_l_op1 - s_f_s_op2) || (ui_l_op1 - s_f_s_op2 != ui_l_op1 - s_d_s_op2) || ((decimal)(ui_l_op1 - s_d_s_op2) != ui_l_op1 - s_m_s_op2) || (ui_l_op1 - s_m_s_op2 != ui_l_op1 - s_i_s_op2) || (ui_l_op1 - s_i_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_i_s_op2 != s_ui_s_op1 - s_ui_s_op2) || (s_ui_s_op1 - s_ui_s_op2 != s_ui_s_op1 - s_l_s_op2) || ((ulong)(s_ui_s_op1 - s_l_s_op2) != s_ui_s_op1 - s_ul_s_op2) || (s_ui_s_op1 - s_ul_s_op2 != s_ui_s_op1 - s_f_s_op2) || (s_ui_s_op1 - s_f_s_op2 != s_ui_s_op1 - s_d_s_op2) || ((decimal)(s_ui_s_op1 - s_d_s_op2) != s_ui_s_op1 - s_m_s_op2) || (s_ui_s_op1 - s_m_s_op2 != s_ui_s_op1 - s_i_s_op2) || (s_ui_s_op1 - s_i_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_i_s_op2 != l_l_op1 - s_ui_s_op2) || (l_l_op1 - s_ui_s_op2 != l_l_op1 - s_l_s_op2) || (l_l_op1 - s_l_s_op2 != l_l_op1 - (long)s_ul_s_op2) || (l_l_op1 - (long)s_ul_s_op2 != l_l_op1 - s_f_s_op2) || (l_l_op1 - s_f_s_op2 != l_l_op1 - s_d_s_op2) || ((decimal)(l_l_op1 - s_d_s_op2) != l_l_op1 - s_m_s_op2) || (l_l_op1 - s_m_s_op2 != l_l_op1 - s_i_s_op2) || (l_l_op1 - s_i_s_op2 != 1))
|
||||
{
|
||||
Console.WriteLine("testcase 10 failed");
|
||||
passed = false;
|
||||
}
|
||||
if ((s_l_s_op1 - i_l_op2 != s_l_s_op1 - ui_l_op2) || (s_l_s_op1 - ui_l_op2 != s_l_s_op1 - l_l_op2) || (s_l_s_op1 - l_l_op2 != s_l_s_op1 - (long)ul_l_op2) || (s_l_s_op1 - (long)ul_l_op2 != s_l_s_op1 - f_l_op2) || (s_l_s_op1 - f_l_op2 != s_l_s_op1 - d_l_op2) || ((decimal)(s_l_s_op1 - d_l_op2) != s_l_s_op1 - m_l_op2) || (s_l_s_op1 - m_l_op2 != s_l_s_op1 - i_l_op2) || (s_l_s_op1 - i_l_op2 != 1))
|
||||
{
|
||||
Console.WriteLine("testcase 11 failed");
|
||||
passed = false;
|
||||
}
|
||||
if ((s_l_s_op1 - s_i_s_op2 != s_l_s_op1 - s_ui_s_op2) || (s_l_s_op1 - s_ui_s_op2 != s_l_s_op1 - s_l_s_op2) || (s_l_s_op1 - s_l_s_op2 != s_l_s_op1 - (long)s_ul_s_op2) || (s_l_s_op1 - (long)s_ul_s_op2 != s_l_s_op1 - s_f_s_op2) || (s_l_s_op1 - s_f_s_op2 != s_l_s_op1 - s_d_s_op2) || ((decimal)(s_l_s_op1 - s_d_s_op2) != s_l_s_op1 - s_m_s_op2) || (s_l_s_op1 - s_m_s_op2 != s_l_s_op1 - s_i_s_op2) || (s_l_s_op1 - s_i_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_i_s_op2 != ul_l_op1 - s_ui_s_op2) || (ul_l_op1 - s_ui_s_op2 != ul_l_op1 - (ulong)s_l_s_op2) || (ul_l_op1 - (ulong)s_l_s_op2 != ul_l_op1 - s_ul_s_op2) || (ul_l_op1 - s_ul_s_op2 != ul_l_op1 - s_f_s_op2) || (ul_l_op1 - s_f_s_op2 != ul_l_op1 - s_d_s_op2) || ((decimal)(ul_l_op1 - s_d_s_op2) != ul_l_op1 - s_m_s_op2) || (ul_l_op1 - s_m_s_op2 != ul_l_op1 - (ulong)s_i_s_op2) || (ul_l_op1 - (ulong)s_i_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_i_s_op2 != s_ul_s_op1 - s_ui_s_op2) || (s_ul_s_op1 - s_ui_s_op2 != s_ul_s_op1 - (ulong)s_l_s_op2) || (s_ul_s_op1 - (ulong)s_l_s_op2 != s_ul_s_op1 - s_ul_s_op2) || (s_ul_s_op1 - s_ul_s_op2 != s_ul_s_op1 - s_f_s_op2) || (s_ul_s_op1 - s_f_s_op2 != s_ul_s_op1 - s_d_s_op2) || ((decimal)(s_ul_s_op1 - s_d_s_op2) != s_ul_s_op1 - s_m_s_op2) || (s_ul_s_op1 - s_m_s_op2 != s_ul_s_op1 - (ulong)s_i_s_op2) || (s_ul_s_op1 - (ulong)s_i_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_i_s_op2 != f_l_op1 - s_ui_s_op2) || (f_l_op1 - s_ui_s_op2 != f_l_op1 - s_l_s_op2) || (f_l_op1 - s_l_s_op2 != f_l_op1 - s_ul_s_op2) || (f_l_op1 - s_ul_s_op2 != f_l_op1 - s_f_s_op2) || (f_l_op1 - s_f_s_op2 != f_l_op1 - s_d_s_op2) || (f_l_op1 - s_d_s_op2 != f_l_op1 - (float)s_m_s_op2) || (f_l_op1 - (float)s_m_s_op2 != f_l_op1 - s_i_s_op2) || (f_l_op1 - s_i_s_op2 != 1))
|
||||
{
|
||||
Console.WriteLine("testcase 18 failed");
|
||||
passed = false;
|
||||
}
|
||||
if ((s_f_s_op1 - i_l_op2 != s_f_s_op1 - ui_l_op2) || (s_f_s_op1 - ui_l_op2 != s_f_s_op1 - l_l_op2) || (s_f_s_op1 - l_l_op2 != s_f_s_op1 - ul_l_op2) || (s_f_s_op1 - ul_l_op2 != s_f_s_op1 - f_l_op2) || (s_f_s_op1 - f_l_op2 != s_f_s_op1 - d_l_op2) || (s_f_s_op1 - d_l_op2 != s_f_s_op1 - (float)m_l_op2) || (s_f_s_op1 - (float)m_l_op2 != s_f_s_op1 - i_l_op2) || (s_f_s_op1 - i_l_op2 != 1))
|
||||
{
|
||||
Console.WriteLine("testcase 19 failed");
|
||||
passed = false;
|
||||
}
|
||||
if ((s_f_s_op1 - s_i_s_op2 != s_f_s_op1 - s_ui_s_op2) || (s_f_s_op1 - s_ui_s_op2 != s_f_s_op1 - s_l_s_op2) || (s_f_s_op1 - s_l_s_op2 != s_f_s_op1 - s_ul_s_op2) || (s_f_s_op1 - s_ul_s_op2 != s_f_s_op1 - s_f_s_op2) || (s_f_s_op1 - s_f_s_op2 != s_f_s_op1 - s_d_s_op2) || (s_f_s_op1 - s_d_s_op2 != s_f_s_op1 - (float)s_m_s_op2) || (s_f_s_op1 - (float)s_m_s_op2 != s_f_s_op1 - s_i_s_op2) || (s_f_s_op1 - s_i_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_i_s_op2 != d_l_op1 - s_ui_s_op2) || (d_l_op1 - s_ui_s_op2 != d_l_op1 - s_l_s_op2) || (d_l_op1 - s_l_s_op2 != d_l_op1 - s_ul_s_op2) || (d_l_op1 - s_ul_s_op2 != d_l_op1 - s_f_s_op2) || (d_l_op1 - s_f_s_op2 != d_l_op1 - s_d_s_op2) || (d_l_op1 - s_d_s_op2 != d_l_op1 - (double)s_m_s_op2) || (d_l_op1 - (double)s_m_s_op2 != d_l_op1 - s_i_s_op2) || (d_l_op1 - s_i_s_op2 != 1))
|
||||
{
|
||||
Console.WriteLine("testcase 22 failed");
|
||||
passed = false;
|
||||
}
|
||||
if ((s_d_s_op1 - i_l_op2 != s_d_s_op1 - ui_l_op2) || (s_d_s_op1 - ui_l_op2 != s_d_s_op1 - l_l_op2) || (s_d_s_op1 - l_l_op2 != s_d_s_op1 - ul_l_op2) || (s_d_s_op1 - ul_l_op2 != s_d_s_op1 - f_l_op2) || (s_d_s_op1 - f_l_op2 != s_d_s_op1 - d_l_op2) || (s_d_s_op1 - d_l_op2 != s_d_s_op1 - (double)m_l_op2) || (s_d_s_op1 - (double)m_l_op2 != s_d_s_op1 - i_l_op2) || (s_d_s_op1 - i_l_op2 != 1))
|
||||
{
|
||||
Console.WriteLine("testcase 23 failed");
|
||||
passed = false;
|
||||
}
|
||||
if ((s_d_s_op1 - s_i_s_op2 != s_d_s_op1 - s_ui_s_op2) || (s_d_s_op1 - s_ui_s_op2 != s_d_s_op1 - s_l_s_op2) || (s_d_s_op1 - s_l_s_op2 != s_d_s_op1 - s_ul_s_op2) || (s_d_s_op1 - s_ul_s_op2 != s_d_s_op1 - s_f_s_op2) || (s_d_s_op1 - s_f_s_op2 != s_d_s_op1 - s_d_s_op2) || (s_d_s_op1 - s_d_s_op2 != s_d_s_op1 - (double)s_m_s_op2) || (s_d_s_op1 - (double)s_m_s_op2 != s_d_s_op1 - s_i_s_op2) || (s_d_s_op1 - s_i_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_i_s_op2 != m_l_op1 - s_ui_s_op2) || (m_l_op1 - s_ui_s_op2 != m_l_op1 - s_l_s_op2) || (m_l_op1 - s_l_s_op2 != m_l_op1 - s_ul_s_op2) || (m_l_op1 - s_ul_s_op2 != m_l_op1 - (decimal)s_f_s_op2) || (m_l_op1 - (decimal)s_f_s_op2 != m_l_op1 - (decimal)s_d_s_op2) || (m_l_op1 - (decimal)s_d_s_op2 != m_l_op1 - s_m_s_op2) || (m_l_op1 - s_m_s_op2 != m_l_op1 - s_i_s_op2) || (m_l_op1 - s_i_s_op2 != 1))
|
||||
{
|
||||
Console.WriteLine("testcase 26 failed");
|
||||
passed = false;
|
||||
}
|
||||
if ((s_m_s_op1 - i_l_op2 != s_m_s_op1 - ui_l_op2) || (s_m_s_op1 - ui_l_op2 != s_m_s_op1 - l_l_op2) || (s_m_s_op1 - l_l_op2 != s_m_s_op1 - ul_l_op2) || (s_m_s_op1 - ul_l_op2 != s_m_s_op1 - (decimal)f_l_op2) || (s_m_s_op1 - (decimal)f_l_op2 != s_m_s_op1 - (decimal)d_l_op2) || (s_m_s_op1 - (decimal)d_l_op2 != s_m_s_op1 - m_l_op2) || (s_m_s_op1 - m_l_op2 != s_m_s_op1 - i_l_op2) || (s_m_s_op1 - i_l_op2 != 1))
|
||||
{
|
||||
Console.WriteLine("testcase 27 failed");
|
||||
passed = false;
|
||||
}
|
||||
if ((s_m_s_op1 - s_i_s_op2 != s_m_s_op1 - s_ui_s_op2) || (s_m_s_op1 - s_ui_s_op2 != s_m_s_op1 - s_l_s_op2) || (s_m_s_op1 - s_l_s_op2 != s_m_s_op1 - s_ul_s_op2) || (s_m_s_op1 - s_ul_s_op2 != s_m_s_op1 - (decimal)s_f_s_op2) || (s_m_s_op1 - (decimal)s_f_s_op2 != s_m_s_op1 - (decimal)s_d_s_op2) || (s_m_s_op1 - (decimal)s_d_s_op2 != s_m_s_op1 - s_m_s_op2) || (s_m_s_op1 - s_m_s_op2 != s_m_s_op1 - s_i_s_op2) || (s_m_s_op1 - s_i_s_op2 != 1))
|
||||
{
|
||||
Console.WriteLine("testcase 28 failed");
|
||||
passed = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!passed)
|
||||
{
|
||||
Console.WriteLine("FAILED");
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("PASSED");
|
||||
return 100;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -16,4 +16,4 @@
|
|||
</PropertyGroup>
|
||||
<MSBuild Projects="cs_template.proj" Properties="AssemblyName1=%(AllSourceFiles.FileName);AllowUnsafeBlocks=True;IntermediateOutputPath=$(IntermediateOutputPath)\%(AllSourceFiles.FileName)\" />
|
||||
</Target>
|
||||
</Project>
|
||||
</Project>
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?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>
|
||||
</packages>
|
27
src/coreclr/tests/src/JIT/Methodical/Arrays/lcs/app.config
Normal file
27
src/coreclr/tests/src/JIT/Methodical/Arrays/lcs/app.config
Normal file
|
@ -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>
|
|
@ -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>
|
123
src/coreclr/tests/src/JIT/Methodical/Arrays/lcs/lcs.cs
Normal file
123
src/coreclr/tests/src/JIT/Methodical/Arrays/lcs/lcs.cs
Normal file
|
@ -0,0 +1,123 @@
|
|||
// 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 JitTest
|
||||
{
|
||||
internal class LCS
|
||||
{
|
||||
private const int RANK = 4;
|
||||
|
||||
private static String buildLCS(int[,,,] b, char[] X, int[] ind)
|
||||
{
|
||||
for (int i = 0; i < RANK; i++)
|
||||
if (ind[i] == 0) return "";
|
||||
|
||||
int L = b[ind[0], ind[1], ind[2], ind[3]];
|
||||
if (L == RANK)
|
||||
{
|
||||
for (int i = 0; i < RANK; i++)
|
||||
ind[i]--;
|
||||
int idx = ind[0];
|
||||
return buildLCS(b, X, ind) + X[idx];
|
||||
}
|
||||
if (L >= 0 && L < RANK)
|
||||
{
|
||||
ind[L]--;
|
||||
return buildLCS(b, X, ind);
|
||||
}
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
private static void findLCS(int[,,,] c, int[,,,] b, char[][] seq, int[] len)
|
||||
{
|
||||
int[] ind = new int[RANK];
|
||||
for (ind[0] = 1; ind[0] < len[0]; ind[0]++)
|
||||
{
|
||||
for (ind[1] = 1; ind[1] < len[1]; ind[1]++)
|
||||
{
|
||||
for (ind[2] = 1; ind[2] < len[2]; ind[2]++)
|
||||
{
|
||||
for (ind[3] = 1; ind[3] < len[3]; ind[3]++)
|
||||
{
|
||||
bool eqFlag = true;
|
||||
for (int i = 1; i < RANK; i++)
|
||||
{
|
||||
if (seq[i][ind[i] - 1] != seq[i - 1][ind[i - 1] - 1])
|
||||
{
|
||||
eqFlag = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (eqFlag)
|
||||
{
|
||||
c[ind[0], ind[1], ind[2], ind[3]] =
|
||||
c[ind[0] - 1, ind[1] - 1, ind[2] - 1, ind[3] - 1] + 1;
|
||||
b[ind[0], ind[1], ind[2], ind[3]] = RANK;
|
||||
continue;
|
||||
}
|
||||
|
||||
int R = -1;
|
||||
int M = -1;
|
||||
for (int i = 0; i < RANK; i++)
|
||||
{
|
||||
ind[i]--;
|
||||
if (c[ind[0], ind[1], ind[2], ind[3]] > M)
|
||||
{
|
||||
R = i;
|
||||
M = c[ind[0], ind[1], ind[2], ind[3]];
|
||||
}
|
||||
ind[i]++;
|
||||
}
|
||||
if (R < 0 || M < 0)
|
||||
throw new Exception();
|
||||
|
||||
c[ind[0], ind[1], ind[2], ind[3]] = M;
|
||||
b[ind[0], ind[1], ind[2], ind[3]] = R;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static int Main()
|
||||
{
|
||||
Console.WriteLine("Test searches for longest common subsequence of 4 strings\n\n");
|
||||
String[] str = new String[RANK] {
|
||||
"The Sun has left his blackness",
|
||||
"and has found a fresher morning",
|
||||
"and the fair Moon rejoices",
|
||||
"in the clear and cloudless night"
|
||||
};
|
||||
|
||||
int[] len = new int[RANK];
|
||||
char[][] seq = new char[RANK][];
|
||||
for (int i = 0; i < RANK; i++)
|
||||
{
|
||||
len[i] = str[i].Length + 1;
|
||||
seq[i] = str[i].ToCharArray();
|
||||
}
|
||||
|
||||
int[,,,] c = new int[len[0], len[1], len[2], len[3]];
|
||||
int[,,,] b = new int[len[0], len[1], len[2], len[3]];
|
||||
|
||||
findLCS(c, b, seq, len);
|
||||
|
||||
for (int i = 0; i < RANK; i++)
|
||||
len[i]--;
|
||||
|
||||
if ("n ha es" == buildLCS(b, seq[0], len))
|
||||
{
|
||||
Console.WriteLine("Test passed");
|
||||
return 100;
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("Test failed.");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
19
src/coreclr/tests/src/JIT/Methodical/Arrays/lcs/lcs.csproj
Normal file
19
src/coreclr/tests/src/JIT/Methodical/Arrays/lcs/lcs.csproj
Normal file
|
@ -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>
|
138
src/coreclr/tests/src/JIT/Methodical/Arrays/lcs/lcs2.cs
Normal file
138
src/coreclr/tests/src/JIT/Methodical/Arrays/lcs/lcs2.cs
Normal file
|
@ -0,0 +1,138 @@
|
|||
// 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 JitTest
|
||||
{
|
||||
internal class LCS
|
||||
{
|
||||
private const int RANK = 4;
|
||||
|
||||
private static String buildLCS(int[][][][] b, char[] X, int[] ind)
|
||||
{
|
||||
for (int i = 0; i < RANK; i++)
|
||||
if (ind[i] == 0) return "";
|
||||
|
||||
int L = b[ind[0]][ind[1]][ind[2]][ind[3]];
|
||||
if (L == RANK)
|
||||
{
|
||||
for (int i = 0; i < RANK; i++)
|
||||
ind[i]--;
|
||||
int idx = ind[0];
|
||||
return buildLCS(b, X, ind) + X[idx];
|
||||
}
|
||||
if (L >= 0 && L < RANK)
|
||||
{
|
||||
ind[L]--;
|
||||
return buildLCS(b, X, ind);
|
||||
}
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
private static void findLCS(ref int[][][][] c, ref int[][][][] b, ref char[][] seq, ref int[] len)
|
||||
{
|
||||
int[] ind = new int[RANK];
|
||||
for (ind[0] = 1; ind[0] < len[0]; ind[0]++)
|
||||
{
|
||||
for (ind[1] = 1; ind[1] < len[1]; ind[1]++)
|
||||
{
|
||||
for (ind[2] = 1; ind[2] < len[2]; ind[2]++)
|
||||
{
|
||||
for (ind[3] = 1; ind[3] < len[3]; ind[3]++)
|
||||
{
|
||||
bool eqFlag = true;
|
||||
for (int i = 1; i < RANK; i++)
|
||||
{
|
||||
if (seq[i][ind[i] - 1] != seq[i - 1][ind[i - 1] - 1])
|
||||
{
|
||||
eqFlag = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (eqFlag)
|
||||
{
|
||||
c[ind[0]][ind[1]][ind[2]][ind[3]] =
|
||||
c[ind[0] - 1][ind[1] - 1][ind[2] - 1][ind[3] - 1] + 1;
|
||||
b[ind[0]][ind[1]][ind[2]][ind[3]] = RANK;
|
||||
continue;
|
||||
}
|
||||
|
||||
int R = -1;
|
||||
int M = -1;
|
||||
for (int i = 0; i < RANK; i++)
|
||||
{
|
||||
ind[i]--;
|
||||
if (c[ind[0]][ind[1]][ind[2]][ind[3]] > M)
|
||||
{
|
||||
R = i;
|
||||
M = c[ind[0]][ind[1]][ind[2]][ind[3]];
|
||||
}
|
||||
ind[i]++;
|
||||
}
|
||||
if (R < 0 || M < 0)
|
||||
throw new Exception();
|
||||
|
||||
c[ind[0]][ind[1]][ind[2]][ind[3]] = M;
|
||||
b[ind[0]][ind[1]][ind[2]][ind[3]] = R;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static int Main()
|
||||
{
|
||||
Console.WriteLine("Test searches for longest common subsequence of 4 strings\n\n");
|
||||
String[] str = {
|
||||
"The Sun has left his blackness",
|
||||
"and has found a fresher morning",
|
||||
"and the fair Moon rejoices",
|
||||
"in the clear and cloudless night"
|
||||
};
|
||||
|
||||
int[] len = new int[RANK];
|
||||
char[][] seq = new char[RANK][];
|
||||
for (int i = 0; i < RANK; i++)
|
||||
{
|
||||
len[i] = str[i].Length + 1;
|
||||
seq[i] = str[i].ToCharArray();
|
||||
}
|
||||
|
||||
int[][][][] c = new int[len[0]][][][];
|
||||
int[][][][] b = new int[len[0]][][][];
|
||||
for (int i = 0; i < len[0]; i++)
|
||||
{
|
||||
c[i] = new int[len[1]][][];
|
||||
b[i] = new int[len[1]][][];
|
||||
for (int j = 0; j < len[1]; j++)
|
||||
{
|
||||
c[i][j] = new int[len[2]][];
|
||||
b[i][j] = new int[len[2]][];
|
||||
for (int k = 0; k < len[2]; k++)
|
||||
{
|
||||
c[i][j][k] = new int[len[3]];
|
||||
b[i][j][k] = new int[len[3]];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
findLCS(ref c, ref b, ref seq, ref len);
|
||||
|
||||
for (int i = 0; i < RANK; i++)
|
||||
len[i]--;
|
||||
|
||||
if ("n ha es" == buildLCS(b, seq[0], len))
|
||||
{
|
||||
Console.WriteLine("Test passed");
|
||||
return 100;
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("Test failed.");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
147
src/coreclr/tests/src/JIT/Methodical/Arrays/lcs/lcsbas.cs
Normal file
147
src/coreclr/tests/src/JIT/Methodical/Arrays/lcs/lcsbas.cs
Normal file
|
@ -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.
|
||||
|
||||
using System;
|
||||
|
||||
namespace JitTest
|
||||
{
|
||||
internal class LCS
|
||||
{
|
||||
private const int RANK = 4;
|
||||
|
||||
private static String buildLCS(int[,,,] b, char[] X, int[] ind)
|
||||
{
|
||||
for (int i = 0; i < RANK; i++)
|
||||
if (ind[i] == 0) return "";
|
||||
|
||||
int L = b[ind[0], ind[1], ind[2], ind[3]];
|
||||
if (L == RANK)
|
||||
{
|
||||
for (int i = 0; i < RANK; i++)
|
||||
ind[i]--;
|
||||
int idx = ind[0];
|
||||
return buildLCS(b, X, ind) + X[idx];
|
||||
}
|
||||
if (L >= 0 && L < RANK)
|
||||
{
|
||||
ind[L]--;
|
||||
return buildLCS(b, X, ind);
|
||||
}
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
private static int get_c(int[,,,] c, params int[] ind)
|
||||
{
|
||||
try
|
||||
{
|
||||
return c[ind[0], ind[1], ind[2], ind[3]];
|
||||
}
|
||||
catch (IndexOutOfRangeException)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
private static int get_cm1(int[,,,] c, int[] ind)
|
||||
{
|
||||
try
|
||||
{
|
||||
return c[ind[0] - 1, ind[1] - 1, ind[2] - 1, ind[3] - 1];
|
||||
}
|
||||
catch (IndexOutOfRangeException)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
private static void findLCS(int[,,,] c, int[,,,] b, char[][] seq, int[] len)
|
||||
{
|
||||
int[] ind = new int[RANK];
|
||||
for (ind[0] = 1; ind[0] < len[0]; ind[0]++)
|
||||
{
|
||||
for (ind[1] = 1; ind[1] < len[1]; ind[1]++)
|
||||
{
|
||||
for (ind[2] = 1; ind[2] < len[2]; ind[2]++)
|
||||
{
|
||||
for (ind[3] = 1; ind[3] < len[3]; ind[3]++)
|
||||
{
|
||||
bool eqFlag = true;
|
||||
for (int i = 1; i < RANK; i++)
|
||||
{
|
||||
if (seq[i][ind[i] - 1] != seq[i - 1][ind[i - 1] - 1])
|
||||
{
|
||||
eqFlag = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (eqFlag)
|
||||
{
|
||||
c[ind[0], ind[1], ind[2], ind[3]] = get_cm1(c, ind) + 1;
|
||||
b[ind[0], ind[1], ind[2], ind[3]] = RANK;
|
||||
continue;
|
||||
}
|
||||
|
||||
int R = -1;
|
||||
int M = -1;
|
||||
for (int i = 0; i < RANK; i++)
|
||||
{
|
||||
ind[i]--;
|
||||
int L = get_c(c, ind);
|
||||
if (L > M)
|
||||
{
|
||||
R = i;
|
||||
M = L;
|
||||
}
|
||||
ind[i]++;
|
||||
}
|
||||
if (R < 0 || M < 0)
|
||||
throw new Exception();
|
||||
|
||||
c[ind[0], ind[1], ind[2], ind[3]] = M;
|
||||
b[ind[0], ind[1], ind[2], ind[3]] = R;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static int Main()
|
||||
{
|
||||
Console.WriteLine("Test searches for longest common subsequence of 4 strings\n\n");
|
||||
String[] str = new String[RANK] {
|
||||
"The Sun has left his blackness",
|
||||
"and has found a fresher morning",
|
||||
"and the fair Moon rejoices",
|
||||
"in the clear and cloudless night"
|
||||
};
|
||||
|
||||
int[] len = new int[RANK];
|
||||
char[][] seq = new char[RANK][];
|
||||
for (int i = 0; i < RANK; i++)
|
||||
{
|
||||
len[i] = str[i].Length + 1;
|
||||
seq[i] = str[i].ToCharArray();
|
||||
}
|
||||
|
||||
int[,,,] c = new int[len[0], len[1], len[2], len[3]];
|
||||
int[,,,] b = new int[len[0], len[1], len[2], len[3]];
|
||||
|
||||
findLCS(c, b, seq, len);
|
||||
|
||||
for (int i = 0; i < RANK; i++)
|
||||
len[i]--;
|
||||
|
||||
if ("n ha es" == buildLCS(b, seq[0], len))
|
||||
{
|
||||
Console.WriteLine("Test passed");
|
||||
return 100;
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("Test failed.");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
124
src/coreclr/tests/src/JIT/Methodical/Arrays/lcs/lcsbox.cs
Normal file
124
src/coreclr/tests/src/JIT/Methodical/Arrays/lcs/lcsbox.cs
Normal file
|
@ -0,0 +1,124 @@
|
|||
// 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 JitTest
|
||||
{
|
||||
internal class LCS
|
||||
{
|
||||
private const int RANK = 4;
|
||||
|
||||
private static String buildLCS(int[,,,] b, char[] X, int[] ind)
|
||||
{
|
||||
for (int i = 0; i < RANK; i++)
|
||||
if (ind[i] == 0) return "";
|
||||
|
||||
int L = (int)b.GetValue(ind);
|
||||
if (L == RANK)
|
||||
{
|
||||
for (int i = 0; i < RANK; i++)
|
||||
ind[i]--;
|
||||
int idx = ind[0];
|
||||
return buildLCS(b, X, ind) + X[idx];
|
||||
}
|
||||
if (L >= 0 && L < RANK)
|
||||
{
|
||||
ind[L]--;
|
||||
return buildLCS(b, X, ind);
|
||||
}
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
private static void findLCS(int[,,,] c, int[,,,] b, char[][] seq, int[] len)
|
||||
{
|
||||
int[] ind = new int[RANK];
|
||||
for (ind[0] = 1; ind[0] < len[0]; ind[0]++)
|
||||
{
|
||||
for (ind[1] = 1; ind[1] < len[1]; ind[1]++)
|
||||
{
|
||||
for (ind[2] = 1; ind[2] < len[2]; ind[2]++)
|
||||
{
|
||||
for (ind[3] = 1; ind[3] < len[3]; ind[3]++)
|
||||
{
|
||||
bool eqFlag = true;
|
||||
for (int i = 1; i < RANK; i++)
|
||||
{
|
||||
if (seq[i][ind[i] - 1] != seq[i - 1][ind[i - 1] - 1])
|
||||
{
|
||||
eqFlag = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (eqFlag)
|
||||
{
|
||||
c.SetValue(c[ind[0] - 1, ind[1] - 1, ind[2] - 1, ind[3] - 1] + 1, ind);
|
||||
b.SetValue(RANK, ind);
|
||||
continue;
|
||||
}
|
||||
|
||||
int R = -1;
|
||||
int M = -1;
|
||||
for (int i = 0; i < RANK; i++)
|
||||
{
|
||||
ind[i]--;
|
||||
int L = (int)c.GetValue(ind);
|
||||
if (L > M)
|
||||
{
|
||||
R = i;
|
||||
M = L;
|
||||
}
|
||||
ind[i]++;
|
||||
}
|
||||
if (R < 0 || M < 0)
|
||||
throw new Exception();
|
||||
|
||||
c.SetValue(M, ind);
|
||||
b.SetValue(R, ind);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static int Main()
|
||||
{
|
||||
Console.WriteLine("Test searches for longest common subsequence of 4 strings\n\n");
|
||||
String[] str = new String[RANK] {
|
||||
"abbdccd",
|
||||
"abcbdcd",
|
||||
"abbcdcd",
|
||||
"bdabccd"
|
||||
};
|
||||
|
||||
int[] len = new int[RANK];
|
||||
char[][] seq = new char[RANK][];
|
||||
for (int i = 0; i < RANK; i++)
|
||||
{
|
||||
len[i] = str[i].Length + 1;
|
||||
seq[i] = str[i].ToCharArray();
|
||||
}
|
||||
|
||||
int[,,,] c = new int[len[0], len[1], len[2], len[3]];
|
||||
int[,,,] b = new int[len[0], len[1], len[2], len[3]];
|
||||
|
||||
findLCS(c, b, seq, len);
|
||||
|
||||
for (int i = 0; i < RANK; i++)
|
||||
len[i]--;
|
||||
|
||||
String lcs = buildLCS(b, seq[0], len);
|
||||
if ("abccd" == lcs)
|
||||
{
|
||||
Console.WriteLine("Test passed");
|
||||
return 100;
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("Test failed.");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
132
src/coreclr/tests/src/JIT/Methodical/Arrays/lcs/lcsmax.cs
Normal file
132
src/coreclr/tests/src/JIT/Methodical/Arrays/lcs/lcsmax.cs
Normal file
|
@ -0,0 +1,132 @@
|
|||
// 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 JitTest
|
||||
{
|
||||
internal class LCS
|
||||
{
|
||||
private const int RANK = 8;
|
||||
|
||||
private static String buildLCS(int[,,,,,,,] b, char[] X, int[] ind)
|
||||
{
|
||||
for (int i = 0; i < RANK; i++)
|
||||
if (ind[i] == 0) return "";
|
||||
|
||||
int L = b[ind[0], ind[1], ind[2], ind[3], ind[4], ind[5], ind[6], ind[7]];
|
||||
if (L == RANK)
|
||||
{
|
||||
for (int i = 0; i < RANK; i++)
|
||||
ind[i]--;
|
||||
int idx = ind[0];
|
||||
return buildLCS(b, X, ind) + X[idx];
|
||||
}
|
||||
if (L >= 0 && L < RANK)
|
||||
{
|
||||
ind[L]--;
|
||||
return buildLCS(b, X, ind);
|
||||
}
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
private static void findLCS(int[,,,,,,,] c, int[,,,,,,,] b, char[][] seq, int[] len)
|
||||
{
|
||||
int[] ind = new int[RANK];
|
||||
for (int i = 0; i < RANK; i++)
|
||||
ind[i] = 1;
|
||||
|
||||
int R = 0;
|
||||
while (R < RANK)
|
||||
{
|
||||
bool eqFlag = true;
|
||||
for (int i = 1; i < RANK; i++)
|
||||
{
|
||||
if (seq[i][ind[i] - 1] != seq[i - 1][ind[i - 1] - 1])
|
||||
{
|
||||
eqFlag = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (eqFlag)
|
||||
{
|
||||
c[ind[0], ind[1], ind[2], ind[3], ind[4], ind[5], ind[6], ind[7]] =
|
||||
c[ind[0] - 1, ind[1] - 1, ind[2] - 1, ind[3] - 1,
|
||||
ind[4] - 1, ind[5] - 1, ind[6] - 1, ind[7] - 1] + 1;
|
||||
b[ind[0], ind[1], ind[2], ind[3], ind[4], ind[5], ind[6], ind[7]] = RANK;
|
||||
}
|
||||
else
|
||||
{
|
||||
R = -1;
|
||||
int M = -1;
|
||||
for (int i = 0; i < RANK; i++)
|
||||
{
|
||||
ind[i]--;
|
||||
if (c[ind[0], ind[1], ind[2], ind[3], ind[4], ind[5], ind[6], ind[7]] > M)
|
||||
{
|
||||
R = i;
|
||||
M = c[ind[0], ind[1], ind[2], ind[3], ind[4], ind[5], ind[6], ind[7]];
|
||||
}
|
||||
ind[i]++;
|
||||
}
|
||||
if (R < 0 || M < 0)
|
||||
throw new Exception();
|
||||
|
||||
c[ind[0], ind[1], ind[2], ind[3], ind[4], ind[5], ind[6], ind[7]] = M;
|
||||
b[ind[0], ind[1], ind[2], ind[3], ind[4], ind[5], ind[6], ind[7]] = R;
|
||||
}
|
||||
|
||||
R = 0;
|
||||
while (R < RANK)
|
||||
{
|
||||
ind[R]++;
|
||||
if (ind[R] < len[R]) break;
|
||||
ind[R++] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static int Main()
|
||||
{
|
||||
Console.WriteLine("Test searches for longest common subsequence of 8 strings\n\n");
|
||||
String[] str = new String[RANK] {
|
||||
"abdc",
|
||||
"badc",
|
||||
"bdacw",
|
||||
"bdca",
|
||||
"bcfdc",
|
||||
"bddsc",
|
||||
"bdccca",
|
||||
"bbdc"
|
||||
};
|
||||
|
||||
int[] len = new int[RANK];
|
||||
char[][] seq = new char[RANK][];
|
||||
for (int i = 0; i < RANK; i++)
|
||||
{
|
||||
len[i] = str[i].Length + 1;
|
||||
seq[i] = str[i].ToCharArray();
|
||||
}
|
||||
|
||||
int[,,,,,,,] c = new int[len[0], len[1], len[2], len[3], len[4], len[5], len[6], len[7]];
|
||||
int[,,,,,,,] b = new int[len[0], len[1], len[2], len[3], len[4], len[5], len[6], len[7]];
|
||||
|
||||
findLCS(c, b, seq, len);
|
||||
|
||||
for (int i = 0; i < RANK; i++)
|
||||
len[i]--;
|
||||
|
||||
if ("bdc" == buildLCS(b, seq[0], len))
|
||||
{
|
||||
Console.WriteLine("Test passed");
|
||||
return 100;
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("Test failed.");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
154
src/coreclr/tests/src/JIT/Methodical/Arrays/lcs/lcsmixed.cs
Normal file
154
src/coreclr/tests/src/JIT/Methodical/Arrays/lcs/lcsmixed.cs
Normal file
|
@ -0,0 +1,154 @@
|
|||
// 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 JitTest
|
||||
{
|
||||
internal class LCS
|
||||
{
|
||||
private const int RANK = 8;
|
||||
|
||||
private static String buildLCS(int[,][,][,][,] b, char[] X, int[] ind)
|
||||
{
|
||||
for (int i = 0; i < RANK; i++)
|
||||
if (ind[i] == 0) return "";
|
||||
|
||||
int L = b[ind[0], ind[1]][ind[2], ind[3]][ind[4], ind[5]][ind[6], ind[7]];
|
||||
if (L == RANK)
|
||||
{
|
||||
for (int i = 0; i < RANK; i++)
|
||||
ind[i]--;
|
||||
int idx = ind[0];
|
||||
return buildLCS(b, X, ind) + X[idx];
|
||||
}
|
||||
if (L >= 0 && L < RANK)
|
||||
{
|
||||
ind[L]--;
|
||||
return buildLCS(b, X, ind);
|
||||
}
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
private static void findLCS(int[,,,][,,,] c, int[,][,][,][,] b, char[][] seq, int[] len)
|
||||
{
|
||||
int[] ind = new int[RANK];
|
||||
for (int i = 0; i < RANK; i++)
|
||||
ind[i] = 1;
|
||||
|
||||
int R = 0;
|
||||
while (R < RANK)
|
||||
{
|
||||
bool eqFlag = true;
|
||||
for (int i = 1; i < RANK; i++)
|
||||
{
|
||||
if (seq[i][ind[i] - 1] != seq[i - 1][ind[i - 1] - 1])
|
||||
{
|
||||
eqFlag = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (eqFlag)
|
||||
{
|
||||
c[ind[0], ind[1], ind[2], ind[3]][ind[4], ind[5], ind[6], ind[7]] =
|
||||
c[ind[0] - 1, ind[1] - 1, ind[2] - 1, ind[3] - 1]
|
||||
[ind[4] - 1, ind[5] - 1, ind[6] - 1, ind[7] - 1] + 1;
|
||||
b[ind[0], ind[1]][ind[2], ind[3]][ind[4], ind[5]][ind[6], ind[7]] = RANK;
|
||||
}
|
||||
else
|
||||
{
|
||||
R = -1;
|
||||
int M = -1;
|
||||
for (int i = 0; i < RANK; i++)
|
||||
{
|
||||
ind[i]--;
|
||||
if (c[ind[0], ind[1], ind[2], ind[3]][ind[4], ind[5], ind[6], ind[7]] > M)
|
||||
{
|
||||
R = i;
|
||||
M = c[ind[0], ind[1], ind[2], ind[3]][ind[4], ind[5], ind[6], ind[7]];
|
||||
}
|
||||
ind[i]++;
|
||||
}
|
||||
if (R < 0 || M < 0)
|
||||
throw new Exception();
|
||||
|
||||
c[ind[0], ind[1], ind[2], ind[3]][ind[4], ind[5], ind[6], ind[7]] = M;
|
||||
b[ind[0], ind[1]][ind[2], ind[3]][ind[4], ind[5]][ind[6], ind[7]] = R;
|
||||
}
|
||||
|
||||
R = 0;
|
||||
while (R < RANK)
|
||||
{
|
||||
ind[R]++;
|
||||
if (ind[R] < len[R]) break;
|
||||
ind[R++] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static int Main()
|
||||
{
|
||||
Console.WriteLine("Test searches for longest common subsequence of 8 strings\n\n");
|
||||
String[] str = {
|
||||
"abdc",
|
||||
"badc",
|
||||
"bdacw",
|
||||
"bdca",
|
||||
"bcfdc",
|
||||
"bddsc",
|
||||
"bdccca",
|
||||
"bbdc"
|
||||
};
|
||||
|
||||
int[] len = new int[RANK];
|
||||
char[][] seq = new char[RANK][];
|
||||
for (int i = 0; i < RANK; i++)
|
||||
{
|
||||
len[i] = str[i].Length + 1;
|
||||
seq[i] = str[i].ToCharArray();
|
||||
}
|
||||
|
||||
// allocate weird matrices
|
||||
int[,,,][,,,] c = new int[len[0], len[1], len[2], len[3]][,,,];
|
||||
int[,][,][,][,] b = new int[len[0], len[1]][,][,][,];
|
||||
int[] ind = new int[RANK];
|
||||
for (ind[0] = 0; ind[0] < len[0]; ind[0]++)
|
||||
{
|
||||
for (ind[1] = 0; ind[1] < len[1]; ind[1]++)
|
||||
{
|
||||
b[ind[0], ind[1]] = new int[len[2], len[3]][,][,];
|
||||
for (ind[2] = 0; ind[2] < len[2]; ind[2]++)
|
||||
{
|
||||
for (ind[3] = 0; ind[3] < len[3]; ind[3]++)
|
||||
{
|
||||
b[ind[0], ind[1]][ind[2], ind[3]] = new int[len[4], len[5]][,];
|
||||
c[ind[0], ind[1], ind[2], ind[3]] = new int[len[4], len[5], len[6], len[7]];
|
||||
for (ind[4] = 0; ind[4] < len[4]; ind[4]++)
|
||||
{
|
||||
for (ind[5] = 0; ind[5] < len[5]; ind[5]++)
|
||||
b[ind[0], ind[1]][ind[2], ind[3]][ind[4], ind[5]] = new int[len[6], len[7]];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
findLCS(c, b, seq, len);
|
||||
|
||||
for (int i = 0; i < RANK; i++)
|
||||
len[i]--;
|
||||
|
||||
if ("bdc" == buildLCS(b, seq[0], len))
|
||||
{
|
||||
Console.WriteLine("Test passed");
|
||||
return 100;
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("Test failed.");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
127
src/coreclr/tests/src/JIT/Methodical/Arrays/lcs/lcsval.cs
Normal file
127
src/coreclr/tests/src/JIT/Methodical/Arrays/lcs/lcsval.cs
Normal file
|
@ -0,0 +1,127 @@
|
|||
// 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 JitTest
|
||||
{
|
||||
internal struct Data
|
||||
{
|
||||
public int b, c;
|
||||
};
|
||||
|
||||
internal class LCS
|
||||
{
|
||||
private const int RANK = 4;
|
||||
|
||||
private static String buildLCS(Data[,,,] mtx, char[] X, int[] ind)
|
||||
{
|
||||
for (int i = 0; i < RANK; i++)
|
||||
if (ind[i] == 0) return "";
|
||||
|
||||
int L = mtx[ind[0], ind[1], ind[2], ind[3]].b;
|
||||
if (L == RANK)
|
||||
{
|
||||
for (int i = 0; i < RANK; i++)
|
||||
ind[i]--;
|
||||
int idx = ind[0];
|
||||
return buildLCS(mtx, X, ind) + X[idx];
|
||||
}
|
||||
if (L >= 0 && L < RANK)
|
||||
{
|
||||
ind[L]--;
|
||||
return buildLCS(mtx, X, ind);
|
||||
}
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
private static void findLCS(Data[,,,] mtx, char[][] seq, int[] len)
|
||||
{
|
||||
int[] ind = new int[RANK];
|
||||
for (ind[0] = 1; ind[0] < len[0]; ind[0]++)
|
||||
{
|
||||
for (ind[1] = 1; ind[1] < len[1]; ind[1]++)
|
||||
{
|
||||
for (ind[2] = 1; ind[2] < len[2]; ind[2]++)
|
||||
{
|
||||
for (ind[3] = 1; ind[3] < len[3]; ind[3]++)
|
||||
{
|
||||
bool eqFlag = true;
|
||||
for (int i = 1; i < RANK; i++)
|
||||
{
|
||||
if (seq[i][ind[i] - 1] != seq[i - 1][ind[i - 1] - 1])
|
||||
{
|
||||
eqFlag = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (eqFlag)
|
||||
{
|
||||
mtx[ind[0], ind[1], ind[2], ind[3]].c =
|
||||
mtx[ind[0] - 1, ind[1] - 1, ind[2] - 1, ind[3] - 1].c + 1;
|
||||
mtx[ind[0], ind[1], ind[2], ind[3]].b = RANK;
|
||||
continue;
|
||||
}
|
||||
|
||||
int R = -1;
|
||||
int M = -1;
|
||||
for (int i = 0; i < RANK; i++)
|
||||
{
|
||||
ind[i]--;
|
||||
if (mtx[ind[0], ind[1], ind[2], ind[3]].c > M)
|
||||
{
|
||||
R = i;
|
||||
M = mtx[ind[0], ind[1], ind[2], ind[3]].c;
|
||||
}
|
||||
ind[i]++;
|
||||
}
|
||||
if (R < 0 || M < 0)
|
||||
throw new Exception();
|
||||
|
||||
mtx[ind[0], ind[1], ind[2], ind[3]].c = M;
|
||||
mtx[ind[0], ind[1], ind[2], ind[3]].b = R;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static int Main()
|
||||
{
|
||||
Console.WriteLine("Test searches for longest common subsequence of 4 strings\n\n");
|
||||
String[] str = new String[RANK] {
|
||||
"The Sun has left his blackness",
|
||||
"and has found a fresher morning",
|
||||
"and the fair Moon rejoices",
|
||||
"in the clear and cloudless night"
|
||||
};
|
||||
|
||||
int[] len = new int[RANK];
|
||||
char[][] seq = new char[RANK][];
|
||||
for (int i = 0; i < RANK; i++)
|
||||
{
|
||||
len[i] = str[i].Length + 1;
|
||||
seq[i] = str[i].ToCharArray();
|
||||
}
|
||||
|
||||
Data[,,,] mtx = new Data[len[0], len[1], len[2], len[3]];
|
||||
|
||||
findLCS(mtx, seq, len);
|
||||
|
||||
for (int i = 0; i < RANK; i++)
|
||||
len[i]--;
|
||||
|
||||
if ("n ha es" == buildLCS(mtx, seq[0], len))
|
||||
{
|
||||
Console.WriteLine("Test passed");
|
||||
return 100;
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("Test failed.");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
145
src/coreclr/tests/src/JIT/Methodical/Arrays/lcs/lcsvalbox.cs
Normal file
145
src/coreclr/tests/src/JIT/Methodical/Arrays/lcs/lcsvalbox.cs
Normal file
|
@ -0,0 +1,145 @@
|
|||
// 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 JitTest
|
||||
{
|
||||
internal struct Data
|
||||
{
|
||||
public int b, c;
|
||||
};
|
||||
|
||||
internal class LCS
|
||||
{
|
||||
private const int RANK = 4;
|
||||
|
||||
private static String buildLCS(object[,,,] mtx, char[] X, int[] ind)
|
||||
{
|
||||
for (int i = 0; i < RANK; i++)
|
||||
if (ind[i] == 0) return "";
|
||||
|
||||
int L = ((Data)mtx[ind[0], ind[1], ind[2], ind[3]]).b;
|
||||
if (L == RANK)
|
||||
{
|
||||
for (int i = 0; i < RANK; i++)
|
||||
ind[i]--;
|
||||
int idx = ind[0];
|
||||
return buildLCS(mtx, X, ind) + X[idx];
|
||||
}
|
||||
if (L >= 0 && L < RANK)
|
||||
{
|
||||
ind[L]--;
|
||||
return buildLCS(mtx, X, ind);
|
||||
}
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
private static void findLCS(object[,,,] mtx, char[][] seq, int[] len)
|
||||
{
|
||||
int[] ind = new int[RANK];
|
||||
for (ind[0] = 1; ind[0] < len[0]; ind[0]++)
|
||||
{
|
||||
for (ind[1] = 1; ind[1] < len[1]; ind[1]++)
|
||||
{
|
||||
for (ind[2] = 1; ind[2] < len[2]; ind[2]++)
|
||||
{
|
||||
for (ind[3] = 1; ind[3] < len[3]; ind[3]++)
|
||||
{
|
||||
bool eqFlag = true;
|
||||
for (int i = 1; i < RANK; i++)
|
||||
{
|
||||
if (seq[i][ind[i] - 1] != seq[i - 1][ind[i - 1] - 1])
|
||||
{
|
||||
eqFlag = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (eqFlag)
|
||||
{
|
||||
Data d;
|
||||
if (mtx[ind[0] - 1, ind[1] - 1, ind[2] - 1, ind[3] - 1] == null)
|
||||
d.c = 1;
|
||||
else
|
||||
d.c = ((Data)mtx[ind[0] - 1, ind[1] - 1, ind[2] - 1, ind[3] - 1]).c + 1;
|
||||
d.b = RANK;
|
||||
mtx[ind[0], ind[1], ind[2], ind[3]] = d;
|
||||
continue;
|
||||
}
|
||||
|
||||
int R = -1;
|
||||
int M = -1;
|
||||
for (int i = 0; i < RANK; i++)
|
||||
{
|
||||
ind[i]--;
|
||||
int cc;
|
||||
try
|
||||
{
|
||||
if (mtx[ind[0], ind[1], ind[2], ind[3]] == null)
|
||||
cc = 0;
|
||||
else
|
||||
cc = ((Data)mtx[ind[0], ind[1], ind[2], ind[3]]).c;
|
||||
}
|
||||
catch (NullReferenceException)
|
||||
{
|
||||
cc = 0;
|
||||
}
|
||||
if (cc > M)
|
||||
{
|
||||
R = i;
|
||||
M = cc;
|
||||
}
|
||||
ind[i]++;
|
||||
}
|
||||
if (R < 0 || M < 0)
|
||||
throw new Exception();
|
||||
|
||||
Data d1;
|
||||
d1.c = M;
|
||||
d1.b = R;
|
||||
mtx[ind[0], ind[1], ind[2], ind[3]] = d1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static int Main()
|
||||
{
|
||||
Console.WriteLine("Test searches for longest common subsequence of 4 strings\n\n");
|
||||
String[] str = new String[RANK] {
|
||||
"The Sun has left his blackness",
|
||||
"and has found a fresher morning",
|
||||
"and the fair Moon rejoices",
|
||||
"in the clear and cloudless night"
|
||||
};
|
||||
|
||||
int[] len = new int[RANK];
|
||||
char[][] seq = new char[RANK][];
|
||||
for (int i = 0; i < RANK; i++)
|
||||
{
|
||||
len[i] = str[i].Length + 1;
|
||||
seq[i] = str[i].ToCharArray();
|
||||
}
|
||||
|
||||
object[,,,] mtx = new object[len[0], len[1], len[2], len[3]];
|
||||
|
||||
findLCS(mtx, seq, len);
|
||||
|
||||
for (int i = 0; i < RANK; i++)
|
||||
len[i]--;
|
||||
|
||||
if ("n ha es" == buildLCS(mtx, seq[0], len))
|
||||
{
|
||||
Console.WriteLine("Test passed");
|
||||
return 100;
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("Test failed.");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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>
|
27
src/coreclr/tests/src/JIT/Methodical/Arrays/misc/app.config
Normal file
27
src/coreclr/tests/src/JIT/Methodical/Arrays/misc/app.config
Normal file
|
@ -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>
|
119
src/coreclr/tests/src/JIT/Methodical/Arrays/misc/arrres.cs
Normal file
119
src/coreclr/tests/src/JIT/Methodical/Arrays/misc/arrres.cs
Normal file
|
@ -0,0 +1,119 @@
|
|||
// 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 GCTest
|
||||
{
|
||||
internal class Test
|
||||
{
|
||||
private int _indx;
|
||||
public bool m_die = false;
|
||||
private static Test[] s_arr = new Test[50];
|
||||
|
||||
public Test(int indx) { _indx = indx; }
|
||||
|
||||
public virtual void CheckValid()
|
||||
{
|
||||
if (s_arr[_indx] != this)
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
~Test()
|
||||
{
|
||||
if (!m_die)
|
||||
{
|
||||
if (s_arr[_indx] != null)
|
||||
{
|
||||
throw new Exception("arr[" + _indx.ToString() + "] != null");
|
||||
}
|
||||
s_arr[_indx] = this;
|
||||
GC.ReRegisterForFinalize(this);
|
||||
}
|
||||
}
|
||||
|
||||
private static int Main()
|
||||
{
|
||||
Test1();
|
||||
Test2();
|
||||
Test3();
|
||||
Test4();
|
||||
Test5();
|
||||
Test6();
|
||||
Console.WriteLine("Test passed.");
|
||||
return 100;
|
||||
}
|
||||
[System.Runtime.CompilerServices.MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
||||
private static void Test1()
|
||||
{
|
||||
for (int i = 0; i < 50; i++)
|
||||
s_arr[i] = new Test(i);
|
||||
GC.Collect();
|
||||
GC.WaitForPendingFinalizers();
|
||||
GC.Collect();
|
||||
}
|
||||
[System.Runtime.CompilerServices.MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
||||
private static void Test2()
|
||||
{
|
||||
for (int i = 0; i < 50; i++)
|
||||
{
|
||||
if (s_arr[i] == null) throw new Exception();
|
||||
s_arr[i].CheckValid();
|
||||
s_arr[i] = null;
|
||||
}
|
||||
GC.Collect();
|
||||
GC.WaitForPendingFinalizers();
|
||||
GC.Collect();
|
||||
}
|
||||
[System.Runtime.CompilerServices.MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
||||
private static void Test3()
|
||||
{
|
||||
for (int i = 0; i < 50; i++)
|
||||
{
|
||||
if (s_arr[i] == null) throw new Exception();
|
||||
s_arr[i].CheckValid();
|
||||
s_arr[i] = null;
|
||||
}
|
||||
GC.Collect();
|
||||
GC.WaitForPendingFinalizers();
|
||||
GC.Collect();
|
||||
}
|
||||
[System.Runtime.CompilerServices.MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
||||
private static void Test4()
|
||||
{
|
||||
for (int i = 0; i < 50; i++)
|
||||
{
|
||||
if (s_arr[i] == null) throw new Exception();
|
||||
s_arr[i].CheckValid();
|
||||
s_arr[i] = null;
|
||||
}
|
||||
GC.Collect();
|
||||
GC.WaitForPendingFinalizers();
|
||||
GC.Collect();
|
||||
}
|
||||
[System.Runtime.CompilerServices.MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
||||
private static void Test5()
|
||||
{
|
||||
for (int i = 0; i < 50; i++)
|
||||
{
|
||||
if (s_arr[i] == null) throw new Exception();
|
||||
s_arr[i].CheckValid();
|
||||
s_arr[i] = null;
|
||||
}
|
||||
GC.Collect();
|
||||
GC.WaitForPendingFinalizers();
|
||||
GC.Collect();
|
||||
}
|
||||
[System.Runtime.CompilerServices.MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
||||
private static void Test6()
|
||||
{
|
||||
for (int i = 0; i < 50; i++)
|
||||
{
|
||||
if (s_arr[i] == null) throw new Exception();
|
||||
s_arr[i].CheckValid();
|
||||
s_arr[i].m_die = true;
|
||||
s_arr[i] = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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>
|
35
src/coreclr/tests/src/JIT/Methodical/Arrays/misc/gcarr.cs
Normal file
35
src/coreclr/tests/src/JIT/Methodical/Arrays/misc/gcarr.cs
Normal file
|
@ -0,0 +1,35 @@
|
|||
// 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 GCTest
|
||||
{
|
||||
internal class Test
|
||||
{
|
||||
private int _magic = 0x12345678;
|
||||
public virtual void CheckValid()
|
||||
{
|
||||
if (_magic != 0x12345678)
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
private static int Main()
|
||||
{
|
||||
Test[] arr = new Test[97];
|
||||
for (int i = 0; i < 97; i++)
|
||||
arr[i] = new Test();
|
||||
GC.Collect();
|
||||
GC.WaitForPendingFinalizers();
|
||||
GC.Collect();
|
||||
for (int i = 0; i < 97; i++)
|
||||
arr[i].CheckValid();
|
||||
arr = null;
|
||||
GC.Collect();
|
||||
GC.WaitForPendingFinalizers();
|
||||
GC.Collect();
|
||||
Console.WriteLine("Test passed.");
|
||||
return 100;
|
||||
}
|
||||
}
|
||||
}
|
19
src/coreclr/tests/src/JIT/Methodical/Arrays/misc/misc.csproj
Normal file
19
src/coreclr/tests/src/JIT/Methodical/Arrays/misc/misc.csproj
Normal file
|
@ -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>
|
|
@ -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>
|
35
src/coreclr/tests/src/JIT/Methodical/Arrays/misc/selfref.cs
Normal file
35
src/coreclr/tests/src/JIT/Methodical/Arrays/misc/selfref.cs
Normal file
|
@ -0,0 +1,35 @@
|
|||
// 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 GCTest
|
||||
{
|
||||
internal class Test
|
||||
{
|
||||
private static int Main()
|
||||
{
|
||||
object aref = null;
|
||||
object[] arr = new object[16];
|
||||
for (int i = arr.GetLowerBound(0); i <= arr.GetUpperBound(0); i++)
|
||||
arr[i] = arr;
|
||||
aref = arr[11];
|
||||
arr = null; //but keep reference to element
|
||||
|
||||
GC.Collect();
|
||||
|
||||
Array a2 = (Array)aref;
|
||||
for (int i = a2.GetLowerBound(0); i <= a2.GetUpperBound(0); i++)
|
||||
{
|
||||
if (((Array)a2.GetValue(i)).GetLowerBound(0) != 0 ||
|
||||
((Array)a2.GetValue(i)).GetUpperBound(0) != 15)
|
||||
{
|
||||
Console.WriteLine("TEST FAILED!");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
Console.WriteLine("TEST PASSED!");
|
||||
return 100;
|
||||
}
|
||||
}
|
||||
}
|
27
src/coreclr/tests/src/JIT/Methodical/AsgOp/i4/app.config
Normal file
27
src/coreclr/tests/src/JIT/Methodical/AsgOp/i4/app.config
Normal file
|
@ -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>
|
|
@ -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>
|
1562
src/coreclr/tests/src/JIT/Methodical/AsgOp/i4/i4.cs
Normal file
1562
src/coreclr/tests/src/JIT/Methodical/AsgOp/i4/i4.cs
Normal file
File diff suppressed because it is too large
Load diff
19
src/coreclr/tests/src/JIT/Methodical/AsgOp/i4/i4.csproj
Normal file
19
src/coreclr/tests/src/JIT/Methodical/AsgOp/i4/i4.csproj
Normal file
|
@ -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>
|
1123
src/coreclr/tests/src/JIT/Methodical/AsgOp/i4/i4flat.cs
Normal file
1123
src/coreclr/tests/src/JIT/Methodical/AsgOp/i4/i4flat.cs
Normal file
File diff suppressed because it is too large
Load diff
|
@ -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>
|
27
src/coreclr/tests/src/JIT/Methodical/AsgOp/i8/app.config
Normal file
27
src/coreclr/tests/src/JIT/Methodical/AsgOp/i8/app.config
Normal file
|
@ -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>
|
|
@ -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>
|
1678
src/coreclr/tests/src/JIT/Methodical/AsgOp/i8/i8.cs
Normal file
1678
src/coreclr/tests/src/JIT/Methodical/AsgOp/i8/i8.cs
Normal file
File diff suppressed because it is too large
Load diff
19
src/coreclr/tests/src/JIT/Methodical/AsgOp/i8/i8.csproj
Normal file
19
src/coreclr/tests/src/JIT/Methodical/AsgOp/i8/i8.csproj
Normal file
|
@ -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>
|
1239
src/coreclr/tests/src/JIT/Methodical/AsgOp/i8/i8flat.cs
Normal file
1239
src/coreclr/tests/src/JIT/Methodical/AsgOp/i8/i8flat.cs
Normal file
File diff suppressed because it is too large
Load diff
|
@ -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>
|
27
src/coreclr/tests/src/JIT/Methodical/AsgOp/r4/app.config
Normal file
27
src/coreclr/tests/src/JIT/Methodical/AsgOp/r4/app.config
Normal file
|
@ -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>
|
|
@ -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>
|
|
@ -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>
|
372
src/coreclr/tests/src/JIT/Methodical/AsgOp/r4/r4.cs
Normal file
372
src/coreclr/tests/src/JIT/Methodical/AsgOp/r4/r4.cs
Normal file
|
@ -0,0 +1,372 @@
|
|||
// 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
|
||||
{
|
||||
private static float f00(float x, float y)
|
||||
{
|
||||
x = x + y;
|
||||
return x;
|
||||
}
|
||||
|
||||
private static float f01(float x, float y)
|
||||
{
|
||||
x = x - y;
|
||||
return x;
|
||||
}
|
||||
|
||||
private static float f02(float x, float y)
|
||||
{
|
||||
x = x * y;
|
||||
return x;
|
||||
}
|
||||
|
||||
private static float f03(float x, float y)
|
||||
{
|
||||
x = x / y;
|
||||
return x;
|
||||
}
|
||||
|
||||
private static float f04(float x, float y)
|
||||
{
|
||||
x = x % y;
|
||||
return x;
|
||||
}
|
||||
|
||||
private static float f10(float x, float y)
|
||||
{
|
||||
x += x + y;
|
||||
return x;
|
||||
}
|
||||
|
||||
private static float f11(float x, float y)
|
||||
{
|
||||
x += x - y;
|
||||
return x;
|
||||
}
|
||||
|
||||
private static float f12(float x, float y)
|
||||
{
|
||||
x += x * y;
|
||||
return x;
|
||||
}
|
||||
|
||||
private static float f13(float x, float y)
|
||||
{
|
||||
x += x / y;
|
||||
return x;
|
||||
}
|
||||
|
||||
private static float f14(float x, float y)
|
||||
{
|
||||
x += x % y;
|
||||
return x;
|
||||
}
|
||||
|
||||
private static float f20(float x, float y)
|
||||
{
|
||||
x -= x + y;
|
||||
return x;
|
||||
}
|
||||
|
||||
private static float f21(float x, float y)
|
||||
{
|
||||
x -= x - y;
|
||||
return x;
|
||||
}
|
||||
|
||||
private static float f22(float x, float y)
|
||||
{
|
||||
x -= x * y;
|
||||
return x;
|
||||
}
|
||||
|
||||
private static float f23(float x, float y)
|
||||
{
|
||||
x -= x / y;
|
||||
return x;
|
||||
}
|
||||
|
||||
private static float f24(float x, float y)
|
||||
{
|
||||
x -= x % y;
|
||||
return x;
|
||||
}
|
||||
|
||||
private static float f30(float x, float y)
|
||||
{
|
||||
x *= x + y;
|
||||
return x;
|
||||
}
|
||||
|
||||
private static float f31(float x, float y)
|
||||
{
|
||||
x *= x - y;
|
||||
return x;
|
||||
}
|
||||
|
||||
private static float f32(float x, float y)
|
||||
{
|
||||
x *= x * y;
|
||||
return x;
|
||||
}
|
||||
|
||||
private static float f33(float x, float y)
|
||||
{
|
||||
x *= x / y;
|
||||
return x;
|
||||
}
|
||||
|
||||
private static float f34(float x, float y)
|
||||
{
|
||||
x *= x % y;
|
||||
return x;
|
||||
}
|
||||
|
||||
private static float f40(float x, float y)
|
||||
{
|
||||
x /= x + y;
|
||||
return x;
|
||||
}
|
||||
|
||||
private static float f41(float x, float y)
|
||||
{
|
||||
x /= x - y;
|
||||
return x;
|
||||
}
|
||||
|
||||
private static float f42(float x, float y)
|
||||
{
|
||||
x /= x * y;
|
||||
return x;
|
||||
}
|
||||
|
||||
private static float f43(float x, float y)
|
||||
{
|
||||
x /= x / y;
|
||||
return x;
|
||||
}
|
||||
|
||||
private static float f44(float x, float y)
|
||||
{
|
||||
x /= x % y;
|
||||
return x;
|
||||
}
|
||||
|
||||
|
||||
public static int Main()
|
||||
{
|
||||
float x;
|
||||
bool pass = true;
|
||||
|
||||
x = f00(-10.0F, 4.0F);
|
||||
if (x != -6)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0F and y is 4.0F");
|
||||
Console.WriteLine("f00 x = x + y; failed.\nx: {0} \texpected: -6\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = f01(-10.0F, 4.0F);
|
||||
if (x != -14)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0F and y is 4.0F");
|
||||
Console.WriteLine("f01 x = x - y; failed.\nx: {0} \texpected: -14\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = f02(-10.0F, 4.0F);
|
||||
if (x != -40)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0F and y is 4.0F");
|
||||
Console.WriteLine("f02 x = x * y; failed.\nx: {0} \texpected: -40\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = f03(-10.0F, 4.0F);
|
||||
if (x != -2.5)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0F and y is 4.0F");
|
||||
Console.WriteLine("f03 x = x / y; failed.\nx: {0} \texpected: -2.5\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = f04(-10.0F, 4.0F);
|
||||
if (x != -2)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0F and y is 4.0F");
|
||||
Console.WriteLine("f04 x = x % y; failed.\nx: {0} \texpected: -2\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = f10(-10.0F, 4.0F);
|
||||
if (x != -16)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0F and y is 4.0F");
|
||||
Console.WriteLine("f10 x += x + y; failed.\nx: {0} \texpected: -16\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = f11(-10.0F, 4.0F);
|
||||
if (x != -24)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0F and y is 4.0F");
|
||||
Console.WriteLine("f11 x += x - y; failed.\nx: {0} \texpected: -24\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = f12(-10.0F, 4.0F);
|
||||
if (x != -50)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0F and y is 4.0F");
|
||||
Console.WriteLine("f12 x += x * y; failed.\nx: {0} \texpected: -50\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = f13(-10.0F, 4.0F);
|
||||
if (x != -12.5)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0F and y is 4.0F");
|
||||
Console.WriteLine("f13 x += x / y; failed.\nx: {0} \texpected: -12.5\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = f14(-10.0F, 4.0F);
|
||||
if (x != -12)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0F and y is 4.0F");
|
||||
Console.WriteLine("f14 x += x % y; failed.\nx: {0} \texpected: -12\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = f20(-10.0F, 4.0F);
|
||||
if (x != -4)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0F and y is 4.0F");
|
||||
Console.WriteLine("f20 x -= x + y; failed.\nx: {0} \texpected: -4\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = f21(-10.0F, 4.0F);
|
||||
if (x != 4)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0F and y is 4.0F");
|
||||
Console.WriteLine("f21 x -= x - y; failed.\nx: {0} \texpected: 4\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = f22(-10.0F, 4.0F);
|
||||
if (x != 30)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0F and y is 4.0F");
|
||||
Console.WriteLine("f22 x -= x * y; failed.\nx: {0} \texpected: 30\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = f23(-10.0F, 4.0F);
|
||||
if (x != -7.5)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0F and y is 4.0F");
|
||||
Console.WriteLine("f23 x -= x / y; failed.\nx: {0} \texpected: -7.5\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = f24(-10.0F, 4.0F);
|
||||
if (x != -8)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0F and y is 4.0F");
|
||||
Console.WriteLine("f24 x -= x % y; failed.\nx: {0} \texpected: -8\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = f30(-10.0F, 4.0F);
|
||||
if (x != 60)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0F and y is 4.0F");
|
||||
Console.WriteLine("f30 x *= x + y; failed.\nx: {0} \texpected: 60\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = f31(-10.0F, 4.0F);
|
||||
if (x != 140)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0F and y is 4.0F");
|
||||
Console.WriteLine("f31 x *= x - y; failed.\nx: {0} \texpected: 140\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = f32(-10.0F, 4.0F);
|
||||
if (x != 400)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0F and y is 4.0F");
|
||||
Console.WriteLine("f32 x *= x * y; failed.\nx: {0} \texpected: 400\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = f33(-10.0F, 4.0F);
|
||||
if (x != 25)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0F and y is 4.0F");
|
||||
Console.WriteLine("f33 x *= x / y; failed.\nx: {0} \texpected: 25\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = f34(-10.0F, 4.0F);
|
||||
if (x != 20)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0F and y is 4.0F");
|
||||
Console.WriteLine("f34 x *= x % y; failed.\nx: {0} \texpected: 20\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = f40(-10.0F, 4.0F);
|
||||
if ((x - 1.66666663F) > Single.Epsilon)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0F and y is 4.0F");
|
||||
Console.WriteLine("f40 x /= x + y; failed.\nx: {0} \texpected: 1.66666663F\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = f41(-10.0F, 4.0F);
|
||||
if (!x.Equals(0.714285731F))
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0F and y is 4.0F");
|
||||
Console.WriteLine("f41 x /= x - y; failed.\nx: {0} \texpected: 0.714285731F\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = f42(-10.0F, 4.0F);
|
||||
if (x != 0.25)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0F and y is 4.0F");
|
||||
Console.WriteLine("f42 x /= x * y; failed.\nx: {0} \texpected: 0.25\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = f43(-10.0F, 4.0F);
|
||||
if (x != 4)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0F and y is 4.0F");
|
||||
Console.WriteLine("f43 x /= x / y; failed.\nx: {0} \texpected: 4\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = f44(-10.0F, 4.0F);
|
||||
if (x != 5)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0F and y is 4.0F");
|
||||
Console.WriteLine("f44 x /= x % y; failed.\nx: {0} \texpected: 5\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
if (pass)
|
||||
{
|
||||
Console.WriteLine("PASSED");
|
||||
return 100;
|
||||
}
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
}
|
19
src/coreclr/tests/src/JIT/Methodical/AsgOp/r4/r4.csproj
Normal file
19
src/coreclr/tests/src/JIT/Methodical/AsgOp/r4/r4.csproj
Normal file
|
@ -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>
|
273
src/coreclr/tests/src/JIT/Methodical/AsgOp/r4/r4flat.cs
Normal file
273
src/coreclr/tests/src/JIT/Methodical/AsgOp/r4/r4flat.cs
Normal file
|
@ -0,0 +1,273 @@
|
|||
// 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
|
||||
{
|
||||
public static int Main()
|
||||
{
|
||||
float x;
|
||||
float y;
|
||||
|
||||
bool pass = true;
|
||||
|
||||
x = -10.0F;
|
||||
y = 4.0F;
|
||||
x = x + y;
|
||||
if (x != -6)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0F and y is 4.0F");
|
||||
Console.WriteLine("x = x + y failed. x: {0}, \texpected: -6\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = -10.0F;
|
||||
y = 4.0F;
|
||||
x = x - y;
|
||||
if (x != -14)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0F and y is 4.0F");
|
||||
Console.WriteLine("x = x - y failed. x: {0}, \texpected: -14\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = -10.0F;
|
||||
y = 4.0F;
|
||||
x = x * y;
|
||||
if (x != -40)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0F and y is 4.0F");
|
||||
Console.WriteLine("x = x * y failed. x: {0}, \texpected: -40\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = -10.0F;
|
||||
y = 4.0F;
|
||||
x = x / y;
|
||||
if (x != -2.5)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0F and y is 4.0F");
|
||||
Console.WriteLine("x = x / y failed. x: {0}, \texpected: -2.5\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = -10.0F;
|
||||
y = 4.0F;
|
||||
x = x % y;
|
||||
if (x != -2)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0F and y is 4.0F");
|
||||
Console.WriteLine("x = x % y failed. x: {0}, \texpected: -2\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = -10.0F;
|
||||
y = 4.0F;
|
||||
x += x + y;
|
||||
if (x != -16)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0F and y is 4.0F");
|
||||
Console.WriteLine("x += x + y failed. x: {0}, \texpected: -16\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = -10.0F;
|
||||
y = 4.0F;
|
||||
x += x - y;
|
||||
if (x != -24)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0F and y is 4.0F");
|
||||
Console.WriteLine("x += x - y failed. x: {0}, \texpected: -24\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = -10.0F;
|
||||
y = 4.0F;
|
||||
x += x * y;
|
||||
if (x != -50)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0F and y is 4.0F");
|
||||
Console.WriteLine("x += x * y failed. x: {0}, \texpected: -50\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = -10.0F;
|
||||
y = 4.0F;
|
||||
x += x / y;
|
||||
if (x != -12.5)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0F and y is 4.0F");
|
||||
Console.WriteLine("x += x / y failed. x: {0}, \texpected: -12.5\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = -10.0F;
|
||||
y = 4.0F;
|
||||
x += x % y;
|
||||
if (x != -12)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0F and y is 4.0F");
|
||||
Console.WriteLine("x += x % y failed. x: {0}, \texpected: -12\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = -10.0F;
|
||||
y = 4.0F;
|
||||
x -= x + y;
|
||||
if (x != -4)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0F and y is 4.0F");
|
||||
Console.WriteLine("x -= x + y failed. x: {0}, \texpected: -4\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = -10.0F;
|
||||
y = 4.0F;
|
||||
x -= x - y;
|
||||
if (x != 4)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0F and y is 4.0F");
|
||||
Console.WriteLine("x -= x - y failed. x: {0}, \texpected: 4\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = -10.0F;
|
||||
y = 4.0F;
|
||||
x -= x * y;
|
||||
if (x != 30)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0F and y is 4.0F");
|
||||
Console.WriteLine("x -= x * y failed. x: {0}, \texpected: 30\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = -10.0F;
|
||||
y = 4.0F;
|
||||
x -= x / y;
|
||||
if (x != -7.5)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0F and y is 4.0F");
|
||||
Console.WriteLine("x -= x / y failed. x: {0}, \texpected: -7.5\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = -10.0F;
|
||||
y = 4.0F;
|
||||
x -= x % y;
|
||||
if (x != -8)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0F and y is 4.0F");
|
||||
Console.WriteLine("x -= x % y failed. x: {0}, \texpected: -8\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = -10.0F;
|
||||
y = 4.0F;
|
||||
x *= x + y;
|
||||
if (x != 60)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0F and y is 4.0F");
|
||||
Console.WriteLine("x *= x + y failed. x: {0}, \texpected: 60\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = -10.0F;
|
||||
y = 4.0F;
|
||||
x *= x - y;
|
||||
if (x != 140)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0F and y is 4.0F");
|
||||
Console.WriteLine("x *= x - y failed. x: {0}, \texpected: 140\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = -10.0F;
|
||||
y = 4.0F;
|
||||
x *= x * y;
|
||||
if (x != 400)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0F and y is 4.0F");
|
||||
Console.WriteLine("x *= x * y failed. x: {0}, \texpected: 400\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = -10.0F;
|
||||
y = 4.0F;
|
||||
x *= x / y;
|
||||
if (x != 25)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0F and y is 4.0F");
|
||||
Console.WriteLine("x *= x / y failed. x: {0}, \texpected: 25\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = -10.0F;
|
||||
y = 4.0F;
|
||||
x *= x % y;
|
||||
if (x != 20)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0F and y is 4.0F");
|
||||
Console.WriteLine("x *= x % y failed. x: {0}, \texpected: 20\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = -10.0F;
|
||||
y = 4.0F;
|
||||
x /= x + y;
|
||||
if (!x.Equals(1.66666663F))
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0F and y is 4.0F");
|
||||
Console.WriteLine("x /= x + y failed. x: {0}, \texpected: 1.66666663F\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = -10.0F;
|
||||
y = 4.0F;
|
||||
x /= x - y;
|
||||
if (!x.Equals(0.714285731F))
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0F and y is 4.0F");
|
||||
Console.WriteLine("x /= x - y failed. x: {0}, \texpected: 0.714285731F\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = -10.0F;
|
||||
y = 4.0F;
|
||||
x /= x * y;
|
||||
if (x != 0.25)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0F and y is 4.0F");
|
||||
Console.WriteLine("x /= x * y failed. x: {0}, \texpected: 0.25\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = -10.0F;
|
||||
y = 4.0F;
|
||||
x /= x / y;
|
||||
if (x != 4)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0F and y is 4.0F");
|
||||
Console.WriteLine("x /= x / y failed. x: {0}, \texpected: 4\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = -10.0F;
|
||||
y = 4.0F;
|
||||
x /= x % y;
|
||||
if (x != 5)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0F and y is 4.0F");
|
||||
Console.WriteLine("x /= x % y failed. x: {0}, \texpected: 5\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
if (pass)
|
||||
{
|
||||
Console.WriteLine("PASSED");
|
||||
return 100;
|
||||
}
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
}
|
27
src/coreclr/tests/src/JIT/Methodical/AsgOp/r8/app.config
Normal file
27
src/coreclr/tests/src/JIT/Methodical/AsgOp/r8/app.config
Normal file
|
@ -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>
|
|
@ -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>
|
|
@ -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>
|
372
src/coreclr/tests/src/JIT/Methodical/AsgOp/r8/r8.cs
Normal file
372
src/coreclr/tests/src/JIT/Methodical/AsgOp/r8/r8.cs
Normal file
|
@ -0,0 +1,372 @@
|
|||
// 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
|
||||
{
|
||||
private static double f00(double x, double y)
|
||||
{
|
||||
x = x + y;
|
||||
return x;
|
||||
}
|
||||
|
||||
private static double f01(double x, double y)
|
||||
{
|
||||
x = x - y;
|
||||
return x;
|
||||
}
|
||||
|
||||
private static double f02(double x, double y)
|
||||
{
|
||||
x = x * y;
|
||||
return x;
|
||||
}
|
||||
|
||||
private static double f03(double x, double y)
|
||||
{
|
||||
x = x / y;
|
||||
return x;
|
||||
}
|
||||
|
||||
private static double f04(double x, double y)
|
||||
{
|
||||
x = x % y;
|
||||
return x;
|
||||
}
|
||||
|
||||
private static double f10(double x, double y)
|
||||
{
|
||||
x += x + y;
|
||||
return x;
|
||||
}
|
||||
|
||||
private static double f11(double x, double y)
|
||||
{
|
||||
x += x - y;
|
||||
return x;
|
||||
}
|
||||
|
||||
private static double f12(double x, double y)
|
||||
{
|
||||
x += x * y;
|
||||
return x;
|
||||
}
|
||||
|
||||
private static double f13(double x, double y)
|
||||
{
|
||||
x += x / y;
|
||||
return x;
|
||||
}
|
||||
|
||||
private static double f14(double x, double y)
|
||||
{
|
||||
x += x % y;
|
||||
return x;
|
||||
}
|
||||
|
||||
private static double f20(double x, double y)
|
||||
{
|
||||
x -= x + y;
|
||||
return x;
|
||||
}
|
||||
|
||||
private static double f21(double x, double y)
|
||||
{
|
||||
x -= x - y;
|
||||
return x;
|
||||
}
|
||||
|
||||
private static double f22(double x, double y)
|
||||
{
|
||||
x -= x * y;
|
||||
return x;
|
||||
}
|
||||
|
||||
private static double f23(double x, double y)
|
||||
{
|
||||
x -= x / y;
|
||||
return x;
|
||||
}
|
||||
|
||||
private static double f24(double x, double y)
|
||||
{
|
||||
x -= x % y;
|
||||
return x;
|
||||
}
|
||||
|
||||
private static double f30(double x, double y)
|
||||
{
|
||||
x *= x + y;
|
||||
return x;
|
||||
}
|
||||
|
||||
private static double f31(double x, double y)
|
||||
{
|
||||
x *= x - y;
|
||||
return x;
|
||||
}
|
||||
|
||||
private static double f32(double x, double y)
|
||||
{
|
||||
x *= x * y;
|
||||
return x;
|
||||
}
|
||||
|
||||
private static double f33(double x, double y)
|
||||
{
|
||||
x *= x / y;
|
||||
return x;
|
||||
}
|
||||
|
||||
private static double f34(double x, double y)
|
||||
{
|
||||
x *= x % y;
|
||||
return x;
|
||||
}
|
||||
|
||||
private static double f40(double x, double y)
|
||||
{
|
||||
x /= x + y;
|
||||
return x;
|
||||
}
|
||||
|
||||
private static double f41(double x, double y)
|
||||
{
|
||||
x /= x - y;
|
||||
return x;
|
||||
}
|
||||
|
||||
private static double f42(double x, double y)
|
||||
{
|
||||
x /= x * y;
|
||||
return x;
|
||||
}
|
||||
|
||||
private static double f43(double x, double y)
|
||||
{
|
||||
x /= x / y;
|
||||
return x;
|
||||
}
|
||||
|
||||
private static double f44(double x, double y)
|
||||
{
|
||||
x /= x % y;
|
||||
return x;
|
||||
}
|
||||
|
||||
|
||||
public static int Main()
|
||||
{
|
||||
double x;
|
||||
bool pass = true;
|
||||
|
||||
x = f00(-10.0, 4.0);
|
||||
if (x != -6)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0 and y is 4.0");
|
||||
Console.WriteLine("f00 x = x + y; failed.\nx: {0} \texpected: -6\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = f01(-10.0, 4.0);
|
||||
if (x != -14)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0 and y is 4.0");
|
||||
Console.WriteLine("f01 x = x - y; failed.\nx: {0} \texpected: -14\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = f02(-10.0, 4.0);
|
||||
if (x != -40)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0 and y is 4.0");
|
||||
Console.WriteLine("f02 x = x * y; failed.\nx: {0} \texpected: -40\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = f03(-10.0, 4.0);
|
||||
if (x != -2.5)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0 and y is 4.0");
|
||||
Console.WriteLine("f03 x = x / y; failed.\nx: {0} \texpected: -2.5\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = f04(-10.0, 4.0);
|
||||
if (x != -2)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0 and y is 4.0");
|
||||
Console.WriteLine("f04 x = x % y; failed.\nx: {0} \texpected: -2\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = f10(-10.0, 4.0);
|
||||
if (x != -16)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0 and y is 4.0");
|
||||
Console.WriteLine("f10 x += x + y; failed.\nx: {0} \texpected: -16\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = f11(-10.0, 4.0);
|
||||
if (x != -24)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0 and y is 4.0");
|
||||
Console.WriteLine("f11 x += x - y; failed.\nx: {0} \texpected: -24\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = f12(-10.0, 4.0);
|
||||
if (x != -50)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0 and y is 4.0");
|
||||
Console.WriteLine("f12 x += x * y; failed.\nx: {0} \texpected: -50\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = f13(-10.0, 4.0);
|
||||
if (x != -12.5)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0 and y is 4.0");
|
||||
Console.WriteLine("f13 x += x / y; failed.\nx: {0} \texpected: -12.5\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = f14(-10.0, 4.0);
|
||||
if (x != -12)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0 and y is 4.0");
|
||||
Console.WriteLine("f14 x += x % y; failed.\nx: {0} \texpected: -12\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = f20(-10.0, 4.0);
|
||||
if (x != -4)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0 and y is 4.0");
|
||||
Console.WriteLine("f20 x -= x + y; failed.\nx: {0} \texpected: -4\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = f21(-10.0, 4.0);
|
||||
if (x != 4)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0 and y is 4.0");
|
||||
Console.WriteLine("f21 x -= x - y; failed.\nx: {0} \texpected: 4\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = f22(-10.0, 4.0);
|
||||
if (x != 30)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0 and y is 4.0");
|
||||
Console.WriteLine("f22 x -= x * y; failed.\nx: {0} \texpected: 30\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = f23(-10.0, 4.0);
|
||||
if (x != -7.5)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0 and y is 4.0");
|
||||
Console.WriteLine("f23 x -= x / y; failed.\nx: {0} \texpected: -7.5\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = f24(-10.0, 4.0);
|
||||
if (x != -8)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0 and y is 4.0");
|
||||
Console.WriteLine("f24 x -= x % y; failed.\nx: {0} \texpected: -8\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = f30(-10.0, 4.0);
|
||||
if (x != 60)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0 and y is 4.0");
|
||||
Console.WriteLine("f30 x *= x + y; failed.\nx: {0} \texpected: 60\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = f31(-10.0, 4.0);
|
||||
if (x != 140)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0 and y is 4.0");
|
||||
Console.WriteLine("f31 x *= x - y; failed.\nx: {0} \texpected: 140\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = f32(-10.0, 4.0);
|
||||
if (x != 400)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0 and y is 4.0");
|
||||
Console.WriteLine("f32 x *= x * y; failed.\nx: {0} \texpected: 400\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = f33(-10.0, 4.0);
|
||||
if (x != 25)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0 and y is 4.0");
|
||||
Console.WriteLine("f33 x *= x / y; failed.\nx: {0} \texpected: 25\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = f34(-10.0, 4.0);
|
||||
if (x != 20)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0 and y is 4.0");
|
||||
Console.WriteLine("f34 x *= x % y; failed.\nx: {0} \texpected: 20\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = f40(-10.0, 4.0);
|
||||
if (!x.Equals(1.6666666666666667D))
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0 and y is 4.0");
|
||||
Console.WriteLine("f40 x /= x + y; failed.\nx: {0} \texpected: 1.6666666666666667\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = f41(-10.0, 4.0);
|
||||
if (!x.Equals(0.7142857142857143))
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0 and y is 4.0");
|
||||
Console.WriteLine("f41 x /= x - y; failed.\nx: {0} \texpected: 0.7142857142857143\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = f42(-10.0, 4.0);
|
||||
if (x != 0.25)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0 and y is 4.0");
|
||||
Console.WriteLine("f42 x /= x * y; failed.\nx: {0} \texpected: 0.25\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = f43(-10.0, 4.0);
|
||||
if (x != 4)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0 and y is 4.0");
|
||||
Console.WriteLine("f43 x /= x / y; failed.\nx: {0} \texpected: 4\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = f44(-10.0, 4.0);
|
||||
if (x != 5)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0 and y is 4.0");
|
||||
Console.WriteLine("f44 x /= x % y; failed.\nx: {0} \texpected: 5\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
if (pass)
|
||||
{
|
||||
Console.WriteLine("PASSED");
|
||||
return 100;
|
||||
}
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
}
|
19
src/coreclr/tests/src/JIT/Methodical/AsgOp/r8/r8.csproj
Normal file
19
src/coreclr/tests/src/JIT/Methodical/AsgOp/r8/r8.csproj
Normal file
|
@ -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>
|
273
src/coreclr/tests/src/JIT/Methodical/AsgOp/r8/r8flat.cs
Normal file
273
src/coreclr/tests/src/JIT/Methodical/AsgOp/r8/r8flat.cs
Normal file
|
@ -0,0 +1,273 @@
|
|||
// 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
|
||||
{
|
||||
public static int Main()
|
||||
{
|
||||
double x;
|
||||
double y;
|
||||
|
||||
bool pass = true;
|
||||
|
||||
x = -10.0;
|
||||
y = 4.0;
|
||||
x = x + y;
|
||||
if (x != -6)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0 and y is 4.0");
|
||||
Console.WriteLine("x = x + y failed. x: {0}, \texpected: -6\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = -10.0;
|
||||
y = 4.0;
|
||||
x = x - y;
|
||||
if (x != -14)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0 and y is 4.0");
|
||||
Console.WriteLine("x = x - y failed. x: {0}, \texpected: -14\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = -10.0;
|
||||
y = 4.0;
|
||||
x = x * y;
|
||||
if (x != -40)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0 and y is 4.0");
|
||||
Console.WriteLine("x = x * y failed. x: {0}, \texpected: -40\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = -10.0;
|
||||
y = 4.0;
|
||||
x = x / y;
|
||||
if (x != -2.5)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0 and y is 4.0");
|
||||
Console.WriteLine("x = x / y failed. x: {0}, \texpected: -2.5\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = -10.0;
|
||||
y = 4.0;
|
||||
x = x % y;
|
||||
if (x != -2)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0 and y is 4.0");
|
||||
Console.WriteLine("x = x % y failed. x: {0}, \texpected: -2\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = -10.0;
|
||||
y = 4.0;
|
||||
x += x + y;
|
||||
if (x != -16)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0 and y is 4.0");
|
||||
Console.WriteLine("x += x + y failed. x: {0}, \texpected: -16\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = -10.0;
|
||||
y = 4.0;
|
||||
x += x - y;
|
||||
if (x != -24)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0 and y is 4.0");
|
||||
Console.WriteLine("x += x - y failed. x: {0}, \texpected: -24\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = -10.0;
|
||||
y = 4.0;
|
||||
x += x * y;
|
||||
if (x != -50)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0 and y is 4.0");
|
||||
Console.WriteLine("x += x * y failed. x: {0}, \texpected: -50\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = -10.0;
|
||||
y = 4.0;
|
||||
x += x / y;
|
||||
if (x != -12.5)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0 and y is 4.0");
|
||||
Console.WriteLine("x += x / y failed. x: {0}, \texpected: -12.5\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = -10.0;
|
||||
y = 4.0;
|
||||
x += x % y;
|
||||
if (x != -12)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0 and y is 4.0");
|
||||
Console.WriteLine("x += x % y failed. x: {0}, \texpected: -12\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = -10.0;
|
||||
y = 4.0;
|
||||
x -= x + y;
|
||||
if (x != -4)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0 and y is 4.0");
|
||||
Console.WriteLine("x -= x + y failed. x: {0}, \texpected: -4\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = -10.0;
|
||||
y = 4.0;
|
||||
x -= x - y;
|
||||
if (x != 4)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0 and y is 4.0");
|
||||
Console.WriteLine("x -= x - y failed. x: {0}, \texpected: 4\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = -10.0;
|
||||
y = 4.0;
|
||||
x -= x * y;
|
||||
if (x != 30)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0 and y is 4.0");
|
||||
Console.WriteLine("x -= x * y failed. x: {0}, \texpected: 30\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = -10.0;
|
||||
y = 4.0;
|
||||
x -= x / y;
|
||||
if (x != -7.5)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0 and y is 4.0");
|
||||
Console.WriteLine("x -= x / y failed. x: {0}, \texpected: -7.5\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = -10.0;
|
||||
y = 4.0;
|
||||
x -= x % y;
|
||||
if (x != -8)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0 and y is 4.0");
|
||||
Console.WriteLine("x -= x % y failed. x: {0}, \texpected: -8\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = -10.0;
|
||||
y = 4.0;
|
||||
x *= x + y;
|
||||
if (x != 60)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0 and y is 4.0");
|
||||
Console.WriteLine("x *= x + y failed. x: {0}, \texpected: 60\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = -10.0;
|
||||
y = 4.0;
|
||||
x *= x - y;
|
||||
if (x != 140)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0 and y is 4.0");
|
||||
Console.WriteLine("x *= x - y failed. x: {0}, \texpected: 140\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = -10.0;
|
||||
y = 4.0;
|
||||
x *= x * y;
|
||||
if (x != 400)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0 and y is 4.0");
|
||||
Console.WriteLine("x *= x * y failed. x: {0}, \texpected: 400\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = -10.0;
|
||||
y = 4.0;
|
||||
x *= x / y;
|
||||
if (x != 25)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0 and y is 4.0");
|
||||
Console.WriteLine("x *= x / y failed. x: {0}, \texpected: 25\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = -10.0;
|
||||
y = 4.0;
|
||||
x *= x % y;
|
||||
if (x != 20)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0 and y is 4.0");
|
||||
Console.WriteLine("x *= x % y failed. x: {0}, \texpected: 20\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = -10.0;
|
||||
y = 4.0;
|
||||
x /= x + y;
|
||||
if (x != 1.6666666666666667)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0 and y is 4.0");
|
||||
Console.WriteLine("x /= x + y failed. x: {0}, \texpected: 1.6666666666666667\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = -10.0;
|
||||
y = 4.0;
|
||||
x /= x - y;
|
||||
if (x != 0.7142857142857143)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0 and y is 4.0");
|
||||
Console.WriteLine("x /= x - y failed. x: {0}, \texpected: 0.7142857142857143\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = -10.0;
|
||||
y = 4.0;
|
||||
x /= x * y;
|
||||
if (x != 0.25)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0 and y is 4.0");
|
||||
Console.WriteLine("x /= x * y failed. x: {0}, \texpected: 0.25\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = -10.0;
|
||||
y = 4.0;
|
||||
x /= x / y;
|
||||
if (x != 4)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0 and y is 4.0");
|
||||
Console.WriteLine("x /= x / y failed. x: {0}, \texpected: 4\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
x = -10.0;
|
||||
y = 4.0;
|
||||
x /= x % y;
|
||||
if (x != 5)
|
||||
{
|
||||
Console.WriteLine("\nInitial parameters: x is -10.0 and y is 4.0");
|
||||
Console.WriteLine("x /= x % y failed. x: {0}, \texpected: 5\n", x);
|
||||
pass = false;
|
||||
}
|
||||
|
||||
if (pass)
|
||||
{
|
||||
Console.WriteLine("PASSED");
|
||||
return 100;
|
||||
}
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
}
|
27
src/coreclr/tests/src/JIT/Methodical/Boxing/misc/app.config
Normal file
27
src/coreclr/tests/src/JIT/Methodical/Boxing/misc/app.config
Normal file
|
@ -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>
|
|
@ -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>
|
46
src/coreclr/tests/src/JIT/Methodical/Boxing/misc/enum.cs
Normal file
46
src/coreclr/tests/src/JIT/Methodical/Boxing/misc/enum.cs
Normal file
|
@ -0,0 +1,46 @@
|
|||
// 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 BoxTest
|
||||
{
|
||||
internal enum ToPrintOrNotToPrint
|
||||
{
|
||||
Print,
|
||||
DoNotPrint
|
||||
}
|
||||
|
||||
internal class Test
|
||||
{
|
||||
protected object Fibonacci(object num, object flag)
|
||||
{
|
||||
if ((ToPrintOrNotToPrint)flag == ToPrintOrNotToPrint.DoNotPrint)
|
||||
return Fibonacci2(num, flag);
|
||||
if (((int)num % 2) == 0)
|
||||
return Fibonacci2(num, flag);
|
||||
return Fibonacci2(num, flag);
|
||||
}
|
||||
|
||||
protected object Fibonacci2(object num, object flag)
|
||||
{
|
||||
int N;
|
||||
if ((int)num <= 1)
|
||||
N = (int)num;
|
||||
else
|
||||
N = (int)Fibonacci((int)num - 2,
|
||||
ToPrintOrNotToPrint.DoNotPrint) + (int)Fibonacci((int)num - 1, flag);
|
||||
if ((ToPrintOrNotToPrint)flag == ToPrintOrNotToPrint.Print)
|
||||
Console.Write(N.ToString() + " ");
|
||||
return N;
|
||||
}
|
||||
|
||||
private static int Main()
|
||||
{
|
||||
new Test().Fibonacci(20, ToPrintOrNotToPrint.Print);
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("*** PASSED ***");
|
||||
return 100;
|
||||
}
|
||||
}
|
||||
}
|
19
src/coreclr/tests/src/JIT/Methodical/Boxing/misc/misc.csproj
Normal file
19
src/coreclr/tests/src/JIT/Methodical/Boxing/misc/misc.csproj
Normal file
|
@ -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>
|
62
src/coreclr/tests/src/JIT/Methodical/Boxing/misc/nestval.cs
Normal file
62
src/coreclr/tests/src/JIT/Methodical/Boxing/misc/nestval.cs
Normal file
|
@ -0,0 +1,62 @@
|
|||
// 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 BoxTest
|
||||
{
|
||||
internal struct MyBool { public bool val; }
|
||||
internal struct MyInt { public int val; }
|
||||
|
||||
internal struct ArgInfo
|
||||
{
|
||||
public MyBool m_flag;
|
||||
public MyInt m_num;
|
||||
}
|
||||
|
||||
internal class Test
|
||||
{
|
||||
protected object Fibonacci(object args)
|
||||
{
|
||||
if (args.GetType() != typeof(ArgInfo))
|
||||
throw new Exception();
|
||||
return FibonacciImpl(args);
|
||||
}
|
||||
|
||||
protected object FibonacciImpl(object args)
|
||||
{
|
||||
object N;
|
||||
if (((ArgInfo)args).m_num.val <= 1)
|
||||
N = ((ArgInfo)args).m_num.val;
|
||||
else
|
||||
{
|
||||
ArgInfo newargs1 = new ArgInfo();
|
||||
newargs1.m_num.val = ((ArgInfo)args).m_num.val - 2;
|
||||
newargs1.m_flag.val = false;
|
||||
ArgInfo newargs2 = new ArgInfo();
|
||||
newargs2.m_num.val = ((ArgInfo)args).m_num.val - 1;
|
||||
newargs2.m_flag.val = ((ArgInfo)args).m_flag.val;
|
||||
N = (int)Fibonacci(newargs1) + (int)Fibonacci(newargs2);
|
||||
}
|
||||
if (((ArgInfo)args).m_flag.val)
|
||||
{
|
||||
if ((((ArgInfo)args).m_num.val % 2) == 0)
|
||||
Console.Write(N.ToString() + " ");
|
||||
else
|
||||
Console.Write(N.ToString() + " ");
|
||||
}
|
||||
return N;
|
||||
}
|
||||
|
||||
private static int Main()
|
||||
{
|
||||
ArgInfo args = new ArgInfo();
|
||||
args.m_flag.val = true;
|
||||
args.m_num.val = 20;
|
||||
new Test().Fibonacci(args);
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("*** PASSED ***");
|
||||
return 100;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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>
|
39
src/coreclr/tests/src/JIT/Methodical/Boxing/misc/tailjump.cs
Normal file
39
src/coreclr/tests/src/JIT/Methodical/Boxing/misc/tailjump.cs
Normal file
|
@ -0,0 +1,39 @@
|
|||
// 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 BoxTest
|
||||
{
|
||||
internal class Test
|
||||
{
|
||||
protected object Fibonacci(object num, object flag)
|
||||
{
|
||||
if ((bool)flag)
|
||||
return Fibonacci2(num, flag);
|
||||
if (((int)num % 2) == 0)
|
||||
return Fibonacci2(num, flag);
|
||||
return Fibonacci2(num, flag);
|
||||
}
|
||||
|
||||
protected object Fibonacci2(object num, object flag)
|
||||
{
|
||||
int N;
|
||||
if ((int)num <= 1)
|
||||
N = (int)num;
|
||||
else
|
||||
N = (int)Fibonacci((int)num - 2, false) + (int)Fibonacci((int)num - 1, flag);
|
||||
if ((bool)flag)
|
||||
Console.Write(N.ToString() + " ");
|
||||
return N;
|
||||
}
|
||||
|
||||
private static int Main()
|
||||
{
|
||||
new Test().Fibonacci(20, true);
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("*** PASSED ***");
|
||||
return 100;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
|
||||
<!-- Default configurations to help VS understand the configurations -->
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
</PropertyGroup>
|
||||
<Target Name="Build">
|
||||
<ItemGroup>
|
||||
<AllSourceFiles Include="$(MSBuildProjectDirectory)\*.cs" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup>
|
||||
<GenerateRunScript>false</GenerateRunScript>
|
||||
</PropertyGroup>
|
||||
<MSBuild Projects="cs_template.proj" Properties="AssemblyName1=%(AllSourceFiles.FileName);AllowUnsafeBlocks=True;IntermediateOutputPath=$(IntermediateOutputPath)\%(AllSourceFiles.FileName)\" />
|
||||
</Target>
|
||||
</Project>
|
27
src/coreclr/tests/src/JIT/Methodical/Coverage/app.config
Normal file
27
src/coreclr/tests/src/JIT/Methodical/Coverage/app.config
Normal file
|
@ -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>
|
65
src/coreclr/tests/src/JIT/Methodical/Coverage/b433189.cs
Normal file
65
src/coreclr/tests/src/JIT/Methodical/Coverage/b433189.cs
Normal file
|
@ -0,0 +1,65 @@
|
|||
// 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.Security;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Threading;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Collections;
|
||||
|
||||
public delegate void MyDelegate();
|
||||
|
||||
public class GenType<T>
|
||||
{
|
||||
[MethodImplAttribute(MethodImplOptions.NoInlining)]
|
||||
public void foo()
|
||||
{
|
||||
bar();
|
||||
}
|
||||
|
||||
public MyDelegate bar()
|
||||
{
|
||||
return new MyDelegate(this.baz);
|
||||
}
|
||||
|
||||
[MethodImplAttribute(MethodImplOptions.NoInlining)]
|
||||
public virtual void baz()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public class cs1
|
||||
{
|
||||
internal static int s_Zero = 0;
|
||||
internal static int s_i = 0;
|
||||
|
||||
public cs1()
|
||||
{
|
||||
}
|
||||
|
||||
[MethodImplAttribute(MethodImplOptions.NoInlining)]
|
||||
public static void foo()
|
||||
{
|
||||
}
|
||||
|
||||
public static int Main(String[] args)
|
||||
{
|
||||
try
|
||||
{
|
||||
GenType<string> o = new GenType<string>();
|
||||
o.foo();
|
||||
Console.WriteLine("Test SUCCESS");
|
||||
return 100;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex);
|
||||
Console.WriteLine("Test FAILED");
|
||||
return 666;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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>
|
|
@ -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>
|
19
src/coreclr/tests/src/JIT/Methodical/FPtrunc/FPtrunc.csproj
Normal file
19
src/coreclr/tests/src/JIT/Methodical/FPtrunc/FPtrunc.csproj
Normal file
|
@ -0,0 +1,19 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
|
||||
<!-- Default configurations to help VS understand the configurations -->
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
</PropertyGroup>
|
||||
<Target Name="Build">
|
||||
<ItemGroup>
|
||||
<AllSourceFiles Include="$(MSBuildProjectDirectory)\*.cs" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup>
|
||||
<GenerateRunScript>false</GenerateRunScript>
|
||||
</PropertyGroup>
|
||||
<MSBuild Projects="cs_template.proj" Properties="AssemblyName1=%(AllSourceFiles.FileName);AllowUnsafeBlocks=True;IntermediateOutputPath=$(IntermediateOutputPath)\%(AllSourceFiles.FileName)\" />
|
||||
</Target>
|
||||
</Project>
|
27
src/coreclr/tests/src/JIT/Methodical/FPtrunc/app.config
Normal file
27
src/coreclr/tests/src/JIT/Methodical/FPtrunc/app.config
Normal file
|
@ -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>
|
353
src/coreclr/tests/src/JIT/Methodical/FPtrunc/convr4a.cs
Normal file
353
src/coreclr/tests/src/JIT/Methodical/FPtrunc/convr4a.cs
Normal file
|
@ -0,0 +1,353 @@
|
|||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
|
||||
//testing float narrowing upon conv.r4 explicit cast
|
||||
|
||||
using System;
|
||||
|
||||
public struct VT
|
||||
{
|
||||
public float f1;
|
||||
public float delta1;
|
||||
public int a1;
|
||||
public float b1;
|
||||
public float temp;
|
||||
}
|
||||
|
||||
public class CL
|
||||
{
|
||||
//used for add and sub
|
||||
public float f1 = 1.0F;
|
||||
public float delta1 = 1.0E-10F;
|
||||
//used for mul and div
|
||||
public int a1 = 3;
|
||||
public float b1 = (1.0F / 3.0F);
|
||||
//used as temp variable
|
||||
public float temp;
|
||||
}
|
||||
|
||||
public class ConvR4test
|
||||
{
|
||||
//static field of a1 class
|
||||
private static float s_f1 = 1.0F;
|
||||
private static float s_delta1 = 1.0E-10F;
|
||||
private static int s_a1 = 3;
|
||||
private static float s_b1 = (1.0F / 3.0F);
|
||||
|
||||
private static void disableInline(ref int x) { }
|
||||
|
||||
//f1 and delta1 are static filed of a1 class
|
||||
private static float floatadd()
|
||||
{
|
||||
int i = 0;
|
||||
disableInline(ref i);
|
||||
return s_f1 + s_delta1;
|
||||
}
|
||||
|
||||
private static float floatsub()
|
||||
{
|
||||
int i = 0;
|
||||
disableInline(ref i);
|
||||
return s_f1 - s_delta1;
|
||||
}
|
||||
|
||||
private static float floatmul()
|
||||
{
|
||||
int i = 0;
|
||||
disableInline(ref i);
|
||||
return s_a1 * s_b1;
|
||||
}
|
||||
|
||||
private static float floatdiv()
|
||||
{
|
||||
int i = 0;
|
||||
disableInline(ref i);
|
||||
return s_f1 / s_a1;
|
||||
}
|
||||
|
||||
private static float floatadd_inline()
|
||||
{
|
||||
return s_f1 + s_delta1;
|
||||
}
|
||||
|
||||
private static float floatsub_inline()
|
||||
{
|
||||
return s_f1 - s_delta1;
|
||||
}
|
||||
|
||||
private static float floatmul_inline()
|
||||
{
|
||||
return s_a1 * s_b1;
|
||||
}
|
||||
|
||||
private static float floatdiv_inline()
|
||||
{
|
||||
return s_f1 / s_a1;
|
||||
}
|
||||
|
||||
public static int Main()
|
||||
{
|
||||
bool pass = true;
|
||||
|
||||
float temp;
|
||||
float[] arr = new float[3];
|
||||
VT vt1;
|
||||
CL cl1 = new CL();
|
||||
|
||||
//*** add ***
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("***add***");
|
||||
|
||||
//local, in-line
|
||||
if (((float)(s_f1 + s_delta1)) != s_f1)
|
||||
{
|
||||
Console.WriteLine("((float)(f1+delta1))!=f1");
|
||||
pass = false;
|
||||
}
|
||||
|
||||
//local
|
||||
temp = s_f1 + s_delta1;
|
||||
if (((float)temp) != s_f1)
|
||||
{
|
||||
Console.WriteLine("((float)temp)!=f1, temp=f1+delta1");
|
||||
pass = false;
|
||||
}
|
||||
|
||||
//method call
|
||||
if (((float)floatadd()) != s_f1)
|
||||
{
|
||||
Console.WriteLine("((float)floatadd())!=f1");
|
||||
pass = false;
|
||||
}
|
||||
|
||||
//inline method call
|
||||
if (((float)floatadd_inline()) != s_f1)
|
||||
{
|
||||
Console.WriteLine("((float)floatadd_inline())!=f1");
|
||||
pass = false;
|
||||
}
|
||||
|
||||
//array element
|
||||
arr[0] = s_f1;
|
||||
arr[1] = s_delta1;
|
||||
arr[2] = arr[0] + arr[1];
|
||||
if (((float)arr[2]) != s_f1)
|
||||
{
|
||||
Console.WriteLine("((float)arr[2])!=f1");
|
||||
pass = false;
|
||||
}
|
||||
|
||||
//struct
|
||||
vt1.f1 = 1.0F;
|
||||
vt1.delta1 = 1.0E-10F;
|
||||
vt1.temp = vt1.f1 + vt1.delta1;
|
||||
if (((float)vt1.temp) != s_f1)
|
||||
{
|
||||
Console.WriteLine("((float)vt1.temp)!=f1");
|
||||
pass = false;
|
||||
}
|
||||
|
||||
//class
|
||||
cl1.temp = cl1.f1 + cl1.delta1;
|
||||
if (((float)cl1.temp) != s_f1)
|
||||
{
|
||||
Console.WriteLine("((float)cl1.temp)!=f1");
|
||||
pass = false;
|
||||
}
|
||||
|
||||
//*** minus ***
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("***sub***");
|
||||
|
||||
//local, in-line
|
||||
if (((float)(s_f1 - s_delta1)) != s_f1)
|
||||
{
|
||||
Console.WriteLine("((float)(f1-delta1))!=f1");
|
||||
pass = false;
|
||||
}
|
||||
|
||||
//local
|
||||
temp = s_f1 - s_delta1;
|
||||
if (((float)temp) != s_f1)
|
||||
{
|
||||
Console.WriteLine("((float)temp)!=f1, temp=f1-delta1");
|
||||
pass = false;
|
||||
}
|
||||
|
||||
//method call
|
||||
if (((float)floatsub()) != s_f1)
|
||||
{
|
||||
Console.WriteLine("((float)floatsub())!=f1");
|
||||
pass = false;
|
||||
}
|
||||
|
||||
//inline method call
|
||||
if (((float)floatsub_inline()) != s_f1)
|
||||
{
|
||||
Console.WriteLine("((float)floatsub_inline())!=f1");
|
||||
pass = false;
|
||||
}
|
||||
|
||||
//array element
|
||||
arr[0] = s_f1;
|
||||
arr[1] = s_delta1;
|
||||
arr[2] = arr[0] - arr[1];
|
||||
if (((float)arr[2]) != s_f1)
|
||||
{
|
||||
Console.WriteLine("((float)arr[2])!=f1");
|
||||
pass = false;
|
||||
}
|
||||
|
||||
//struct
|
||||
vt1.f1 = 1.0F;
|
||||
vt1.delta1 = 1.0E-10F;
|
||||
vt1.temp = vt1.f1 - vt1.delta1;
|
||||
if (((float)vt1.temp) != s_f1)
|
||||
{
|
||||
Console.WriteLine("((float)vt1.temp)!=f1");
|
||||
pass = false;
|
||||
}
|
||||
|
||||
//class
|
||||
cl1.temp = cl1.f1 - cl1.delta1;
|
||||
if (((float)cl1.temp) != s_f1)
|
||||
{
|
||||
Console.WriteLine("((float)cl1.temp)!=f1");
|
||||
pass = false;
|
||||
}
|
||||
|
||||
//*** multiply ***
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("***mul***");
|
||||
|
||||
//local, in-line
|
||||
if (((float)(s_a1 * s_b1)) != s_f1)
|
||||
{
|
||||
Console.WriteLine("((float)(a1*b1))!=f1");
|
||||
pass = false;
|
||||
}
|
||||
|
||||
//local
|
||||
temp = s_a1 * s_b1;
|
||||
if (((float)temp) != s_f1)
|
||||
{
|
||||
Console.WriteLine("((float)temp)!=f1, temp=a1*b1");
|
||||
pass = false;
|
||||
}
|
||||
|
||||
//method call
|
||||
if (((float)floatmul()) != s_f1)
|
||||
{
|
||||
Console.WriteLine("((float)floatmul())!=f1");
|
||||
pass = false;
|
||||
}
|
||||
|
||||
//inline method call
|
||||
if (((float)floatmul_inline()) != s_f1)
|
||||
{
|
||||
Console.WriteLine("((float)floatmul_inline())!=f1");
|
||||
pass = false;
|
||||
}
|
||||
|
||||
//array element
|
||||
arr[0] = s_a1;
|
||||
arr[1] = s_b1;
|
||||
arr[2] = arr[0] * arr[1];
|
||||
if (((float)arr[2]) != s_f1)
|
||||
{
|
||||
Console.WriteLine("((float)arr[2])!=f1");
|
||||
pass = false;
|
||||
}
|
||||
|
||||
//struct
|
||||
vt1.a1 = 3;
|
||||
vt1.b1 = 1.0F / 3.0F;
|
||||
vt1.temp = vt1.a1 * vt1.b1;
|
||||
if (((float)vt1.temp) != s_f1)
|
||||
{
|
||||
Console.WriteLine("((float)vt1.temp)!=f1");
|
||||
pass = false;
|
||||
}
|
||||
|
||||
//class
|
||||
cl1.temp = cl1.a1 * cl1.b1;
|
||||
if (((float)cl1.temp) != s_f1)
|
||||
{
|
||||
Console.WriteLine("((float)cl1.temp)!=f1");
|
||||
pass = false;
|
||||
}
|
||||
|
||||
//*** divide ***
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("***div***");
|
||||
|
||||
//local, in-line
|
||||
if (((float)(s_f1 / s_a1)) != s_b1)
|
||||
{
|
||||
Console.WriteLine("((float)(f1/a1))!=b1");
|
||||
pass = false;
|
||||
}
|
||||
|
||||
//local
|
||||
temp = s_f1 / s_a1;
|
||||
if (((float)temp) != s_b1)
|
||||
{
|
||||
Console.WriteLine("((float)temp)!=f1, temp=f1/a1");
|
||||
pass = false;
|
||||
}
|
||||
|
||||
//method call
|
||||
if (((float)floatdiv()) != s_b1)
|
||||
{
|
||||
Console.WriteLine("((float)floatdivl())!=b1");
|
||||
pass = false;
|
||||
}
|
||||
|
||||
//method call
|
||||
if (((float)floatdiv_inline()) != s_b1)
|
||||
{
|
||||
Console.WriteLine("((float)floatdiv_inline())!=b1");
|
||||
pass = false;
|
||||
}
|
||||
|
||||
//array element
|
||||
arr[0] = s_f1;
|
||||
arr[1] = s_a1;
|
||||
arr[2] = arr[0] / arr[1];
|
||||
if (((float)arr[2]) != s_b1)
|
||||
{
|
||||
Console.WriteLine("((float)arr[2])!=b1");
|
||||
pass = false;
|
||||
}
|
||||
|
||||
//struct
|
||||
vt1.f1 = 1.0F;
|
||||
vt1.a1 = 3;
|
||||
vt1.temp = vt1.f1 / vt1.a1;
|
||||
if (((float)vt1.temp) != s_b1)
|
||||
{
|
||||
Console.WriteLine("((float)vt1.temp)!=b1");
|
||||
pass = false;
|
||||
}
|
||||
|
||||
//class
|
||||
cl1.temp = cl1.f1 / cl1.a1;
|
||||
if (((float)cl1.temp) != s_b1)
|
||||
{
|
||||
Console.WriteLine("((float)cl1.temp)!=b1");
|
||||
pass = false;
|
||||
}
|
||||
|
||||
Console.WriteLine();
|
||||
if (pass)
|
||||
{
|
||||
Console.WriteLine("SUCCESS");
|
||||
return 100;
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("FAILURE: float not truncated properly");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
353
src/coreclr/tests/src/JIT/Methodical/FPtrunc/convr8a.cs
Normal file
353
src/coreclr/tests/src/JIT/Methodical/FPtrunc/convr8a.cs
Normal file
|
@ -0,0 +1,353 @@
|
|||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
|
||||
//testing double narrowing
|
||||
|
||||
using System;
|
||||
|
||||
public struct VT
|
||||
{
|
||||
public double f1;
|
||||
public double delta1;
|
||||
public int a1;
|
||||
public double b1;
|
||||
public double temp;
|
||||
}
|
||||
|
||||
public class CL
|
||||
{
|
||||
//used for add and sub
|
||||
public double f1 = 1.0;
|
||||
public double delta1 = 1.0E-18;
|
||||
//used for mul and div
|
||||
public int a1 = 3;
|
||||
public double b1 = (1.0 / 3.0);
|
||||
//used as temp variable
|
||||
public double temp;
|
||||
}
|
||||
|
||||
public class ConvR8test
|
||||
{
|
||||
//static field of a1 class
|
||||
private static double s_f1 = 1.0;
|
||||
private static double s_delta1 = 1.0E-18;
|
||||
private static int s_a1 = 3;
|
||||
private static double s_b1 = (1.0 / 3.0);
|
||||
|
||||
private static void disableInline(ref int x) { }
|
||||
|
||||
//f1 and delta1 are static filed of a1 class
|
||||
private static double doubleadd()
|
||||
{
|
||||
int i = 0;
|
||||
disableInline(ref i);
|
||||
return s_f1 + s_delta1;
|
||||
}
|
||||
|
||||
private static double doublesub()
|
||||
{
|
||||
int i = 0;
|
||||
disableInline(ref i);
|
||||
return s_f1 - s_delta1;
|
||||
}
|
||||
|
||||
private static double doublemul()
|
||||
{
|
||||
int i = 0;
|
||||
disableInline(ref i);
|
||||
return s_a1 * s_b1;
|
||||
}
|
||||
|
||||
private static double doublediv()
|
||||
{
|
||||
int i = 0;
|
||||
disableInline(ref i);
|
||||
return s_f1 / s_a1;
|
||||
}
|
||||
|
||||
private static double doubleadd_inline()
|
||||
{
|
||||
return s_f1 + s_delta1;
|
||||
}
|
||||
|
||||
private static double doublesub_inline()
|
||||
{
|
||||
return s_f1 - s_delta1;
|
||||
}
|
||||
|
||||
private static double doublemul_inline()
|
||||
{
|
||||
return s_a1 * s_b1;
|
||||
}
|
||||
|
||||
private static double doublediv_inline()
|
||||
{
|
||||
return s_f1 / s_a1;
|
||||
}
|
||||
|
||||
public static int Main()
|
||||
{
|
||||
bool pass = true;
|
||||
|
||||
double temp;
|
||||
double[] arr = new double[3];
|
||||
VT vt1;
|
||||
CL cl1 = new CL();
|
||||
|
||||
//*** add ***
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("***add***");
|
||||
|
||||
//local, in-line
|
||||
if (((double)(s_f1 + s_delta1)) != s_f1)
|
||||
{
|
||||
Console.WriteLine("((double)(f1+delta1))!=f1");
|
||||
pass = false;
|
||||
}
|
||||
|
||||
//local
|
||||
temp = s_f1 + s_delta1;
|
||||
if (((double)temp) != s_f1)
|
||||
{
|
||||
Console.WriteLine("((double)temp)!=f1, temp=f1+delta1");
|
||||
pass = false;
|
||||
}
|
||||
|
||||
//method call
|
||||
if (((double)doubleadd()) != s_f1)
|
||||
{
|
||||
Console.WriteLine("((double)doubleadd())!=f1");
|
||||
pass = false;
|
||||
}
|
||||
|
||||
//inline method call
|
||||
if (((double)doubleadd_inline()) != s_f1)
|
||||
{
|
||||
Console.WriteLine("((double)doubleadd_inline())!=f1");
|
||||
pass = false;
|
||||
}
|
||||
|
||||
//array element
|
||||
arr[0] = s_f1;
|
||||
arr[1] = s_delta1;
|
||||
arr[2] = arr[0] + arr[1];
|
||||
if (((double)arr[2]) != s_f1)
|
||||
{
|
||||
Console.WriteLine("((double)arr[2])!=f1");
|
||||
pass = false;
|
||||
}
|
||||
|
||||
//struct
|
||||
vt1.f1 = 1.0;
|
||||
vt1.delta1 = 1.0E-18;
|
||||
vt1.temp = vt1.f1 + vt1.delta1;
|
||||
if (((double)vt1.temp) != s_f1)
|
||||
{
|
||||
Console.WriteLine("((double)vt1.temp)!=f1");
|
||||
pass = false;
|
||||
}
|
||||
|
||||
//class
|
||||
cl1.temp = cl1.f1 + cl1.delta1;
|
||||
if (((double)cl1.temp) != s_f1)
|
||||
{
|
||||
Console.WriteLine("((double)cl1.temp)!=f1");
|
||||
pass = false;
|
||||
}
|
||||
|
||||
//*** minus ***
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("***sub***");
|
||||
|
||||
//local, in-line
|
||||
if (((double)(s_f1 - s_delta1)) != s_f1)
|
||||
{
|
||||
Console.WriteLine("((double)(f1-delta1))!=f1");
|
||||
pass = false;
|
||||
}
|
||||
|
||||
//local
|
||||
temp = s_f1 - s_delta1;
|
||||
if (((double)temp) != s_f1)
|
||||
{
|
||||
Console.WriteLine("((double)temp)!=f1, temp=f1-delta1");
|
||||
pass = false;
|
||||
}
|
||||
|
||||
//method call
|
||||
if (((double)doublesub()) != s_f1)
|
||||
{
|
||||
Console.WriteLine("((double)doublesub())!=f1");
|
||||
pass = false;
|
||||
}
|
||||
|
||||
//inline method call
|
||||
if (((double)doublesub_inline()) != s_f1)
|
||||
{
|
||||
Console.WriteLine("((double)doublesub_inline())!=f1");
|
||||
pass = false;
|
||||
}
|
||||
|
||||
//array element
|
||||
arr[0] = s_f1;
|
||||
arr[1] = s_delta1;
|
||||
arr[2] = arr[0] - arr[1];
|
||||
if (((double)arr[2]) != s_f1)
|
||||
{
|
||||
Console.WriteLine("((double)arr[2])!=f1");
|
||||
pass = false;
|
||||
}
|
||||
|
||||
//struct
|
||||
vt1.f1 = 1.0;
|
||||
vt1.delta1 = 1.0E-18;
|
||||
vt1.temp = vt1.f1 - vt1.delta1;
|
||||
if (((double)vt1.temp) != s_f1)
|
||||
{
|
||||
Console.WriteLine("((double)vt1.temp)!=f1");
|
||||
pass = false;
|
||||
}
|
||||
|
||||
//class
|
||||
cl1.temp = cl1.f1 - cl1.delta1;
|
||||
if (((double)cl1.temp) != s_f1)
|
||||
{
|
||||
Console.WriteLine("((double)cl1.temp)!=f1");
|
||||
pass = false;
|
||||
}
|
||||
|
||||
//*** multiply ***
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("***mul***");
|
||||
|
||||
//local, in-line
|
||||
if (((double)(s_a1 * s_b1)) != s_f1)
|
||||
{
|
||||
Console.WriteLine("((double)(a1*b1))!=f1");
|
||||
pass = false;
|
||||
}
|
||||
|
||||
//local
|
||||
temp = s_a1 * s_b1;
|
||||
if (((double)temp) != s_f1)
|
||||
{
|
||||
Console.WriteLine("((double)temp)!=f1, temp=a1*b1");
|
||||
pass = false;
|
||||
}
|
||||
|
||||
//method call
|
||||
if (((double)doublemul()) != s_f1)
|
||||
{
|
||||
Console.WriteLine("((double)doublemul())!=f1");
|
||||
pass = false;
|
||||
}
|
||||
|
||||
//inline method call
|
||||
if (((double)doublemul_inline()) != s_f1)
|
||||
{
|
||||
Console.WriteLine("((double)doublemul_inline())!=f1");
|
||||
pass = false;
|
||||
}
|
||||
|
||||
//array element
|
||||
arr[0] = s_a1;
|
||||
arr[1] = s_b1;
|
||||
arr[2] = arr[0] * arr[1];
|
||||
if (((double)arr[2]) != s_f1)
|
||||
{
|
||||
Console.WriteLine("((double)arr[2])!=f1");
|
||||
pass = false;
|
||||
}
|
||||
|
||||
//struct
|
||||
vt1.a1 = 3;
|
||||
vt1.b1 = 1.0 / 3.0;
|
||||
vt1.temp = vt1.a1 * vt1.b1;
|
||||
if (((double)vt1.temp) != s_f1)
|
||||
{
|
||||
Console.WriteLine("((double)vt1.temp)!=f1");
|
||||
pass = false;
|
||||
}
|
||||
|
||||
//class
|
||||
cl1.temp = cl1.a1 * cl1.b1;
|
||||
if (((double)cl1.temp) != s_f1)
|
||||
{
|
||||
Console.WriteLine("((double)cl1.temp)!=f1");
|
||||
pass = false;
|
||||
}
|
||||
|
||||
//*** divide ***
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("***div***");
|
||||
|
||||
//local, in-line
|
||||
if (((double)(s_f1 / s_a1)) != s_b1)
|
||||
{
|
||||
Console.WriteLine("((double)(f1/a1))!=b1");
|
||||
pass = false;
|
||||
}
|
||||
|
||||
//local
|
||||
temp = s_f1 / s_a1;
|
||||
if (((double)temp) != s_b1)
|
||||
{
|
||||
Console.WriteLine("((double)temp)!=f1, temp=f1/a1");
|
||||
pass = false;
|
||||
}
|
||||
|
||||
//method call
|
||||
if (((double)doublediv()) != s_b1)
|
||||
{
|
||||
Console.WriteLine("((double)doubledivl())!=b1");
|
||||
pass = false;
|
||||
}
|
||||
|
||||
//method call
|
||||
if (((double)doublediv_inline()) != s_b1)
|
||||
{
|
||||
Console.WriteLine("((double)doublediv_inline())!=b1");
|
||||
pass = false;
|
||||
}
|
||||
|
||||
//array element
|
||||
arr[0] = s_f1;
|
||||
arr[1] = s_a1;
|
||||
arr[2] = arr[0] / arr[1];
|
||||
if (((double)arr[2]) != s_b1)
|
||||
{
|
||||
Console.WriteLine("((double)arr[2])!=b1");
|
||||
pass = false;
|
||||
}
|
||||
|
||||
//struct
|
||||
vt1.f1 = 1.0;
|
||||
vt1.a1 = 3;
|
||||
vt1.temp = vt1.f1 / vt1.a1;
|
||||
if (((double)vt1.temp) != s_b1)
|
||||
{
|
||||
Console.WriteLine("((double)vt1.temp)!=b1");
|
||||
pass = false;
|
||||
}
|
||||
|
||||
//class
|
||||
cl1.temp = cl1.f1 / cl1.a1;
|
||||
if (((double)cl1.temp) != s_b1)
|
||||
{
|
||||
Console.WriteLine("((double)cl1.temp)!=b1");
|
||||
pass = false;
|
||||
}
|
||||
|
||||
Console.WriteLine();
|
||||
if (pass)
|
||||
{
|
||||
Console.WriteLine("SUCCESS");
|
||||
return 100;
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("FAILURE: double not truncated properly");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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>
|
|
@ -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>
|
|
@ -0,0 +1,66 @@
|
|||
// 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
|
||||
{
|
||||
private static int f1(int a1, int a2, int a3, int a4, int a5,
|
||||
int a6, int a7, int a8, int a9, int a10,
|
||||
int a11, int a12, int a13, int a14, int a15,
|
||||
int a16, int a17, int a18, int a19, int a20,
|
||||
int a21, int a22, int a23, int a24, int a25)
|
||||
{
|
||||
int sum = a1 + a2 + a3 + a4 + a5 + a6 + a7 + a8 + a9 + a10
|
||||
+ a11 + a12 + a13 + a14 + a15 + a16 + a17 + a18 + a19
|
||||
+ a20 + a21 + a22 + a23 + a24 + a25;
|
||||
Console.WriteLine("The sum is {0}", sum);
|
||||
return sum;
|
||||
}
|
||||
|
||||
private static int f(int a1, int a2, int a3, int a4, int a5,
|
||||
int a6, int a7, int a8, int a9, int a10,
|
||||
int a11, int a12, int a13, int a14, int a15,
|
||||
int a16, int a17, int a18, int a19, int a20,
|
||||
int a21, int a22, int a23, int a24, int a25)
|
||||
{
|
||||
Console.WriteLine(a1);
|
||||
Console.WriteLine(a2);
|
||||
Console.WriteLine(a3);
|
||||
Console.WriteLine(a4);
|
||||
Console.WriteLine(a5);
|
||||
Console.WriteLine(a6);
|
||||
Console.WriteLine(a7);
|
||||
Console.WriteLine(a8);
|
||||
Console.WriteLine(a9);
|
||||
Console.WriteLine(a10);
|
||||
Console.WriteLine(a11);
|
||||
Console.WriteLine(a12);
|
||||
Console.WriteLine(a13);
|
||||
Console.WriteLine(a14);
|
||||
Console.WriteLine(a15);
|
||||
Console.WriteLine(a16);
|
||||
Console.WriteLine(a17);
|
||||
Console.WriteLine(a18);
|
||||
Console.WriteLine(a19);
|
||||
Console.WriteLine(a20);
|
||||
Console.WriteLine(a21);
|
||||
Console.WriteLine(a22);
|
||||
Console.WriteLine(a23);
|
||||
Console.WriteLine(a24);
|
||||
Console.WriteLine(a25);
|
||||
int sum = f1(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15,
|
||||
a16, a17, a18, a19, a20, a21, a22, a23, a24, a25);
|
||||
return sum;
|
||||
}
|
||||
|
||||
private static int Main()
|
||||
{
|
||||
Console.WriteLine("Testing method of 25 parameters, all of int data type");
|
||||
int sum = f(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25);
|
||||
if (sum == 325)
|
||||
return 100;
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,79 @@
|
|||
// 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 int m;
|
||||
}
|
||||
public class CL
|
||||
{
|
||||
public int n;
|
||||
public CL(int a)
|
||||
{
|
||||
n = a;
|
||||
}
|
||||
}
|
||||
internal class test
|
||||
{
|
||||
private static int f1(short a1, ushort a2, int a3, uint a4, long a5,
|
||||
ulong a6, byte a7, sbyte a8, Decimal a9, int[] a10,
|
||||
VT a11, CL a12, int a13, int a14, int a15,
|
||||
int a16, int a17, int a18, int a19, int a20,
|
||||
int a21, int a22, int a23, int a24, int a25)
|
||||
{
|
||||
int sum = (int)(a1 + a2 + a3 + a4 + (int)a5 + (int)a6 + a7 + a8 + (int)a9 + a10[0]
|
||||
+ a11.m + a12.n + a13 + a14 + a15 + a16 + a17 + a18 + a19
|
||||
+ a20 + a21 + a22 + a23 + a24 + a25);
|
||||
Console.WriteLine("The sum is {0}", sum);
|
||||
return sum;
|
||||
}
|
||||
|
||||
private static int f(short a1, ushort a2, int a3, uint a4, long a5,
|
||||
ulong a6, byte a7, sbyte a8, Decimal a9, int[] a10,
|
||||
VT a11, CL a12, int a13, int a14, int a15,
|
||||
int a16, int a17, int a18, int a19, int a20,
|
||||
int a21, int a22, int a23, int a24, int a25)
|
||||
{
|
||||
Console.WriteLine(a1);
|
||||
Console.WriteLine(a2);
|
||||
Console.WriteLine(a3);
|
||||
Console.WriteLine(a4);
|
||||
Console.WriteLine(a5);
|
||||
Console.WriteLine(a6);
|
||||
Console.WriteLine(a7);
|
||||
Console.WriteLine(a8);
|
||||
Console.WriteLine(a9);
|
||||
Console.WriteLine(a10[0]);
|
||||
Console.WriteLine(a11.m);
|
||||
Console.WriteLine(a12.n);
|
||||
Console.WriteLine(a13);
|
||||
Console.WriteLine(a14);
|
||||
Console.WriteLine(a15);
|
||||
Console.WriteLine(a16);
|
||||
Console.WriteLine(a17);
|
||||
Console.WriteLine(a18);
|
||||
Console.WriteLine(a19);
|
||||
Console.WriteLine(a20);
|
||||
Console.WriteLine(a21);
|
||||
Console.WriteLine(a22);
|
||||
Console.WriteLine(a23);
|
||||
Console.WriteLine(a24);
|
||||
Console.WriteLine(a25);
|
||||
int sum = f1(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15,
|
||||
a16, a17, a18, a19, a20, a21, a22, a23, a24, a25);
|
||||
return sum;
|
||||
}
|
||||
|
||||
private static int Main()
|
||||
{
|
||||
Console.WriteLine("Testing method of 25 parameters, mixed data type");
|
||||
VT vt = new VT();
|
||||
vt.m = 11;
|
||||
CL cl = new CL(12);
|
||||
int sum = f(1, 2, 3, 4, 5, 6, 7, 8, 9, new int[1] { 10 }, vt, cl, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25);
|
||||
if (sum == 325) return 100;
|
||||
else return 1;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,333 @@
|
|||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
|
||||
// long chain of methods
|
||||
|
||||
using System;
|
||||
internal class test
|
||||
{
|
||||
private static int f1(int a1, int a2, int a3, int a4, int a5,
|
||||
int a6, int a7, int a8, int a9, int a10,
|
||||
int a11, int a12, int a13, int a14, int a15,
|
||||
int a16, int a17, int a18, int a19, int a20,
|
||||
int a21, int a22, int a23, int a24, int a25)
|
||||
{
|
||||
Console.WriteLine(a1);
|
||||
int sum = f2(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15,
|
||||
a16, a17, a18, a19, a20, a21, a22, a23, a24, a25);
|
||||
return sum;
|
||||
}
|
||||
|
||||
private static int f2(int a1, int a2, int a3, int a4, int a5,
|
||||
int a6, int a7, int a8, int a9, int a10,
|
||||
int a11, int a12, int a13, int a14, int a15,
|
||||
int a16, int a17, int a18, int a19, int a20,
|
||||
int a21, int a22, int a23, int a24, int a25)
|
||||
{
|
||||
Console.WriteLine(a2);
|
||||
int sum = f3(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15,
|
||||
a16, a17, a18, a19, a20, a21, a22, a23, a24, a25);
|
||||
return sum;
|
||||
}
|
||||
|
||||
private static int f3(int a1, int a2, int a3, int a4, int a5,
|
||||
int a6, int a7, int a8, int a9, int a10,
|
||||
int a11, int a12, int a13, int a14, int a15,
|
||||
int a16, int a17, int a18, int a19, int a20,
|
||||
int a21, int a22, int a23, int a24, int a25)
|
||||
{
|
||||
Console.WriteLine(a3);
|
||||
int sum = f4(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15,
|
||||
a16, a17, a18, a19, a20, a21, a22, a23, a24, a25);
|
||||
return sum;
|
||||
}
|
||||
|
||||
private static int f4(int a1, int a2, int a3, int a4, int a5,
|
||||
int a6, int a7, int a8, int a9, int a10,
|
||||
int a11, int a12, int a13, int a14, int a15,
|
||||
int a16, int a17, int a18, int a19, int a20,
|
||||
int a21, int a22, int a23, int a24, int a25)
|
||||
{
|
||||
Console.WriteLine(a4);
|
||||
int sum = f5(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15,
|
||||
a16, a17, a18, a19, a20, a21, a22, a23, a24, a25);
|
||||
return sum;
|
||||
}
|
||||
|
||||
private static int f5(int a1, int a2, int a3, int a4, int a5,
|
||||
int a6, int a7, int a8, int a9, int a10,
|
||||
int a11, int a12, int a13, int a14, int a15,
|
||||
int a16, int a17, int a18, int a19, int a20,
|
||||
int a21, int a22, int a23, int a24, int a25)
|
||||
{
|
||||
Console.WriteLine(a5);
|
||||
int sum = f6(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15,
|
||||
a16, a17, a18, a19, a20, a21, a22, a23, a24, a25);
|
||||
return sum;
|
||||
}
|
||||
|
||||
private static int f6(int a1, int a2, int a3, int a4, int a5,
|
||||
int a6, int a7, int a8, int a9, int a10,
|
||||
int a11, int a12, int a13, int a14, int a15,
|
||||
int a16, int a17, int a18, int a19, int a20,
|
||||
int a21, int a22, int a23, int a24, int a25)
|
||||
{
|
||||
Console.WriteLine(a6);
|
||||
int sum = f7(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15,
|
||||
a16, a17, a18, a19, a20, a21, a22, a23, a24, a25);
|
||||
return sum;
|
||||
}
|
||||
|
||||
private static int f7(int a1, int a2, int a3, int a4, int a5,
|
||||
int a6, int a7, int a8, int a9, int a10,
|
||||
int a11, int a12, int a13, int a14, int a15,
|
||||
int a16, int a17, int a18, int a19, int a20,
|
||||
int a21, int a22, int a23, int a24, int a25)
|
||||
{
|
||||
Console.WriteLine(a7);
|
||||
int sum = f8(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15,
|
||||
a16, a17, a18, a19, a20, a21, a22, a23, a24, a25);
|
||||
return sum;
|
||||
}
|
||||
|
||||
private static int f8(int a1, int a2, int a3, int a4, int a5,
|
||||
int a6, int a7, int a8, int a9, int a10,
|
||||
int a11, int a12, int a13, int a14, int a15,
|
||||
int a16, int a17, int a18, int a19, int a20,
|
||||
int a21, int a22, int a23, int a24, int a25)
|
||||
{
|
||||
Console.WriteLine(a8);
|
||||
int sum = f9(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15,
|
||||
a16, a17, a18, a19, a20, a21, a22, a23, a24, a25);
|
||||
return sum;
|
||||
}
|
||||
|
||||
private static int f9(int a1, int a2, int a3, int a4, int a5,
|
||||
int a6, int a7, int a8, int a9, int a10,
|
||||
int a11, int a12, int a13, int a14, int a15,
|
||||
int a16, int a17, int a18, int a19, int a20,
|
||||
int a21, int a22, int a23, int a24, int a25)
|
||||
{
|
||||
Console.WriteLine(a9);
|
||||
int sum = f10(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15,
|
||||
a16, a17, a18, a19, a20, a21, a22, a23, a24, a25);
|
||||
return sum;
|
||||
}
|
||||
|
||||
private static int f10(int a1, int a2, int a3, int a4, int a5,
|
||||
int a6, int a7, int a8, int a9, int a10,
|
||||
int a11, int a12, int a13, int a14, int a15,
|
||||
int a16, int a17, int a18, int a19, int a20,
|
||||
int a21, int a22, int a23, int a24, int a25)
|
||||
{
|
||||
Console.WriteLine(a10);
|
||||
int sum = f11(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15,
|
||||
a16, a17, a18, a19, a20, a21, a22, a23, a24, a25);
|
||||
return sum;
|
||||
}
|
||||
|
||||
private static int f11(int a1, int a2, int a3, int a4, int a5,
|
||||
int a6, int a7, int a8, int a9, int a10,
|
||||
int a11, int a12, int a13, int a14, int a15,
|
||||
int a16, int a17, int a18, int a19, int a20,
|
||||
int a21, int a22, int a23, int a24, int a25)
|
||||
{
|
||||
Console.WriteLine(a11);
|
||||
int sum = f12(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15,
|
||||
a16, a17, a18, a19, a20, a21, a22, a23, a24, a25);
|
||||
return sum;
|
||||
}
|
||||
|
||||
private static int f12(int a1, int a2, int a3, int a4, int a5,
|
||||
int a6, int a7, int a8, int a9, int a10,
|
||||
int a11, int a12, int a13, int a14, int a15,
|
||||
int a16, int a17, int a18, int a19, int a20,
|
||||
int a21, int a22, int a23, int a24, int a25)
|
||||
{
|
||||
Console.WriteLine(a12);
|
||||
int sum = f13(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15,
|
||||
a16, a17, a18, a19, a20, a21, a22, a23, a24, a25);
|
||||
return sum;
|
||||
}
|
||||
|
||||
private static int f13(int a1, int a2, int a3, int a4, int a5,
|
||||
int a6, int a7, int a8, int a9, int a10,
|
||||
int a11, int a12, int a13, int a14, int a15,
|
||||
int a16, int a17, int a18, int a19, int a20,
|
||||
int a21, int a22, int a23, int a24, int a25)
|
||||
{
|
||||
Console.WriteLine(a13);
|
||||
int sum = f14(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15,
|
||||
a16, a17, a18, a19, a20, a21, a22, a23, a24, a25);
|
||||
return sum;
|
||||
}
|
||||
|
||||
private static int f14(int a1, int a2, int a3, int a4, int a5,
|
||||
int a6, int a7, int a8, int a9, int a10,
|
||||
int a11, int a12, int a13, int a14, int a15,
|
||||
int a16, int a17, int a18, int a19, int a20,
|
||||
int a21, int a22, int a23, int a24, int a25)
|
||||
{
|
||||
Console.WriteLine(a14);
|
||||
int sum = f15(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15,
|
||||
a16, a17, a18, a19, a20, a21, a22, a23, a24, a25);
|
||||
return sum;
|
||||
}
|
||||
|
||||
private static int f15(int a1, int a2, int a3, int a4, int a5,
|
||||
int a6, int a7, int a8, int a9, int a10,
|
||||
int a11, int a12, int a13, int a14, int a15,
|
||||
int a16, int a17, int a18, int a19, int a20,
|
||||
int a21, int a22, int a23, int a24, int a25)
|
||||
{
|
||||
Console.WriteLine(a15);
|
||||
int sum = f16(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15,
|
||||
a16, a17, a18, a19, a20, a21, a22, a23, a24, a25);
|
||||
return sum;
|
||||
}
|
||||
|
||||
private static int f16(int a1, int a2, int a3, int a4, int a5,
|
||||
int a6, int a7, int a8, int a9, int a10,
|
||||
int a11, int a12, int a13, int a14, int a15,
|
||||
int a16, int a17, int a18, int a19, int a20,
|
||||
int a21, int a22, int a23, int a24, int a25)
|
||||
{
|
||||
Console.WriteLine(a16);
|
||||
int sum = f17(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15,
|
||||
a16, a17, a18, a19, a20, a21, a22, a23, a24, a25);
|
||||
return sum;
|
||||
}
|
||||
|
||||
private static int f17(int a1, int a2, int a3, int a4, int a5,
|
||||
int a6, int a7, int a8, int a9, int a10,
|
||||
int a11, int a12, int a13, int a14, int a15,
|
||||
int a16, int a17, int a18, int a19, int a20,
|
||||
int a21, int a22, int a23, int a24, int a25)
|
||||
{
|
||||
Console.WriteLine(a17);
|
||||
int sum = f18(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15,
|
||||
a16, a17, a18, a19, a20, a21, a22, a23, a24, a25);
|
||||
return sum;
|
||||
}
|
||||
|
||||
private static int f18(int a1, int a2, int a3, int a4, int a5,
|
||||
int a6, int a7, int a8, int a9, int a10,
|
||||
int a11, int a12, int a13, int a14, int a15,
|
||||
int a16, int a17, int a18, int a19, int a20,
|
||||
int a21, int a22, int a23, int a24, int a25)
|
||||
{
|
||||
Console.WriteLine(a18);
|
||||
int sum = f19(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15,
|
||||
a16, a17, a18, a19, a20, a21, a22, a23, a24, a25);
|
||||
return sum;
|
||||
}
|
||||
|
||||
private static int f19(int a1, int a2, int a3, int a4, int a5,
|
||||
int a6, int a7, int a8, int a9, int a10,
|
||||
int a11, int a12, int a13, int a14, int a15,
|
||||
int a16, int a17, int a18, int a19, int a20,
|
||||
int a21, int a22, int a23, int a24, int a25)
|
||||
{
|
||||
Console.WriteLine(a19);
|
||||
int sum = f20(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15,
|
||||
a16, a17, a18, a19, a20, a21, a22, a23, a24, a25);
|
||||
return sum;
|
||||
}
|
||||
|
||||
private static int f20(int a1, int a2, int a3, int a4, int a5,
|
||||
int a6, int a7, int a8, int a9, int a10,
|
||||
int a11, int a12, int a13, int a14, int a15,
|
||||
int a16, int a17, int a18, int a19, int a20,
|
||||
int a21, int a22, int a23, int a24, int a25)
|
||||
{
|
||||
Console.WriteLine(a20);
|
||||
int sum = f21(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15,
|
||||
a16, a17, a18, a19, a20, a21, a22, a23, a24, a25);
|
||||
return sum;
|
||||
}
|
||||
|
||||
private static int f21(int a1, int a2, int a3, int a4, int a5,
|
||||
int a6, int a7, int a8, int a9, int a10,
|
||||
int a11, int a12, int a13, int a14, int a15,
|
||||
int a16, int a17, int a18, int a19, int a20,
|
||||
int a21, int a22, int a23, int a24, int a25)
|
||||
{
|
||||
Console.WriteLine(a21);
|
||||
int sum = f22(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15,
|
||||
a16, a17, a18, a19, a20, a21, a22, a23, a24, a25);
|
||||
return sum;
|
||||
}
|
||||
|
||||
private static int f22(int a1, int a2, int a3, int a4, int a5,
|
||||
int a6, int a7, int a8, int a9, int a10,
|
||||
int a11, int a12, int a13, int a14, int a15,
|
||||
int a16, int a17, int a18, int a19, int a20,
|
||||
int a21, int a22, int a23, int a24, int a25)
|
||||
{
|
||||
Console.WriteLine(a22);
|
||||
int sum = f23(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15,
|
||||
a16, a17, a18, a19, a20, a21, a22, a23, a24, a25);
|
||||
return sum;
|
||||
}
|
||||
|
||||
private static int f23(int a1, int a2, int a3, int a4, int a5,
|
||||
int a6, int a7, int a8, int a9, int a10,
|
||||
int a11, int a12, int a13, int a14, int a15,
|
||||
int a16, int a17, int a18, int a19, int a20,
|
||||
int a21, int a22, int a23, int a24, int a25)
|
||||
{
|
||||
Console.WriteLine(a23);
|
||||
int sum = f24(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15,
|
||||
a16, a17, a18, a19, a20, a21, a22, a23, a24, a25);
|
||||
return sum;
|
||||
}
|
||||
|
||||
private static int f24(int a1, int a2, int a3, int a4, int a5,
|
||||
int a6, int a7, int a8, int a9, int a10,
|
||||
int a11, int a12, int a13, int a14, int a15,
|
||||
int a16, int a17, int a18, int a19, int a20,
|
||||
int a21, int a22, int a23, int a24, int a25)
|
||||
{
|
||||
Console.WriteLine(a24);
|
||||
int sum = f25(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15,
|
||||
a16, a17, a18, a19, a20, a21, a22, a23, a24, a25);
|
||||
return sum;
|
||||
}
|
||||
|
||||
private static int f25(int a1, int a2, int a3, int a4, int a5,
|
||||
int a6, int a7, int a8, int a9, int a10,
|
||||
int a11, int a12, int a13, int a14, int a15,
|
||||
int a16, int a17, int a18, int a19, int a20,
|
||||
int a21, int a22, int a23, int a24, int a25)
|
||||
{
|
||||
Console.WriteLine(a25);
|
||||
int sum = a1 + a2 + a3 + a4 + a5 + a6 + a7 + a8 + a9 + a10
|
||||
+ a11 + a12 + a13 + a14 + a15 + a16 + a17 + a18 + a19
|
||||
+ a20 + a21 + a22 + a23 + a24 + a25;
|
||||
return sum;
|
||||
}
|
||||
|
||||
|
||||
private static int f(int a1, int a2, int a3, int a4, int a5,
|
||||
int a6, int a7, int a8, int a9, int a10,
|
||||
int a11, int a12, int a13, int a14, int a15,
|
||||
int a16, int a17, int a18, int a19, int a20,
|
||||
int a21, int a22, int a23, int a24, int a25)
|
||||
{
|
||||
int sum = f1(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15,
|
||||
a16, a17, a18, a19, a20, a21, a22, a23, a24, a25);
|
||||
return sum;
|
||||
}
|
||||
|
||||
private static int Main()
|
||||
{
|
||||
Console.WriteLine("Testing method of 25 parameters, all of int data type, long chain of method calls");
|
||||
int sum = f(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25);
|
||||
Console.WriteLine("The sum is {0}", sum);
|
||||
if (sum == 325)
|
||||
return 100;
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
|
@ -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>
|
|
@ -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>
|
|
@ -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>
|
|
@ -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>
|
19
src/coreclr/tests/src/JIT/Methodical/Invoke/SEH/SEH.csproj
Normal file
19
src/coreclr/tests/src/JIT/Methodical/Invoke/SEH/SEH.csproj
Normal file
|
@ -0,0 +1,19 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
|
||||
<!-- Default configurations to help VS understand the configurations -->
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
</PropertyGroup>
|
||||
<Target Name="Build">
|
||||
<ItemGroup>
|
||||
<AllSourceFiles Include="$(MSBuildProjectDirectory)\*.cs" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup>
|
||||
<GenerateRunScript>false</GenerateRunScript>
|
||||
</PropertyGroup>
|
||||
<MSBuild Projects="cs_template.proj" Properties="AssemblyName1=%(AllSourceFiles.FileName);AllowUnsafeBlocks=True;IntermediateOutputPath=$(IntermediateOutputPath)\%(AllSourceFiles.FileName)\" />
|
||||
</Target>
|
||||
</Project>
|
27
src/coreclr/tests/src/JIT/Methodical/Invoke/SEH/app.config
Normal file
27
src/coreclr/tests/src/JIT/Methodical/Invoke/SEH/app.config
Normal file
|
@ -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>
|
110
src/coreclr/tests/src/JIT/Methodical/Invoke/SEH/catchfinally.cs
Normal file
110
src/coreclr/tests/src/JIT/Methodical/Invoke/SEH/catchfinally.cs
Normal file
|
@ -0,0 +1,110 @@
|
|||
// 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 JitTest
|
||||
{
|
||||
internal class Test
|
||||
{
|
||||
private static bool s_globalFlag = false;
|
||||
|
||||
private static bool TestTryCatch(int recurseLevel)
|
||||
{
|
||||
if (recurseLevel > 1)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (s_globalFlag = !s_globalFlag)
|
||||
{
|
||||
//call recursively
|
||||
return TestTryFinally(recurseLevel - 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
//raise an exception and allow the handler work
|
||||
int[] p = null;
|
||||
p[0] = 0;
|
||||
|
||||
//paranoid check
|
||||
Console.WriteLine("Shouldn't have reached here.");
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
catch (NullReferenceException)
|
||||
{
|
||||
return TestTryCatch(recurseLevel);
|
||||
}
|
||||
}
|
||||
return recurseLevel == 0;
|
||||
}
|
||||
|
||||
private static bool TestTryFinally(int recurseLevel)
|
||||
{
|
||||
if (recurseLevel > 1)
|
||||
{
|
||||
bool ret = false;
|
||||
try
|
||||
{
|
||||
bool runHandler = false;
|
||||
try
|
||||
{
|
||||
if (s_globalFlag = !s_globalFlag)
|
||||
{
|
||||
//call recursively
|
||||
return TestTryCatch(recurseLevel - 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
runHandler = true;
|
||||
|
||||
//raise an exception and allow the handler work
|
||||
int[] p = null;
|
||||
p[0] = 0;
|
||||
|
||||
//paranoid check
|
||||
Console.WriteLine("Shouldn't have reached here.");
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (runHandler)
|
||||
{
|
||||
ret = TestTryFinally(recurseLevel);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (NullReferenceException)
|
||||
{
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
return recurseLevel == 0;
|
||||
}
|
||||
|
||||
private static int Main()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (TestTryCatch(15) || !TestTryCatch(18))
|
||||
{
|
||||
Console.WriteLine("try...catch test failed.");
|
||||
return 1;
|
||||
}
|
||||
if (TestTryFinally(19) || !TestTryFinally(12))
|
||||
{
|
||||
Console.WriteLine("try...finally test failed.");
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
Console.WriteLine("Failed w/ exception");
|
||||
return -1;
|
||||
}
|
||||
Console.WriteLine("Passed");
|
||||
return 100;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,118 @@
|
|||
// 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 JitTest
|
||||
{
|
||||
internal class Test1
|
||||
{
|
||||
private static bool s_globalFlag = false,s_globalFlag2 = true;
|
||||
|
||||
private static bool TestTryCatch(int recurseLevel)
|
||||
{
|
||||
if (recurseLevel > 1)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (s_globalFlag = !s_globalFlag)
|
||||
{
|
||||
//call recursively
|
||||
return TestTryCatch(recurseLevel - 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
//raise an exception and allow the handler work
|
||||
int[] p = null;
|
||||
p[0] = 0;
|
||||
|
||||
//paranoid check
|
||||
Console.WriteLine("Shouldn't have reached here.");
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
catch (NullReferenceException)
|
||||
{
|
||||
return Test(recurseLevel);
|
||||
}
|
||||
}
|
||||
return recurseLevel == 0;
|
||||
}
|
||||
|
||||
private static bool TestTryFinally(int recurseLevel)
|
||||
{
|
||||
if (recurseLevel > 1)
|
||||
{
|
||||
bool ret = false;
|
||||
try
|
||||
{
|
||||
bool runHandler = false;
|
||||
try
|
||||
{
|
||||
if (s_globalFlag = !s_globalFlag)
|
||||
{
|
||||
//call recursively
|
||||
return Test(recurseLevel - 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
runHandler = true;
|
||||
|
||||
//raise an exception and allow the handler work
|
||||
int[] p = null;
|
||||
p[0] = 0;
|
||||
|
||||
//paranoid check
|
||||
Console.WriteLine("Shouldn't have reached here.");
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (runHandler)
|
||||
{
|
||||
ret = TestTryCatch(recurseLevel);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (NullReferenceException)
|
||||
{
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
return recurseLevel == 0;
|
||||
}
|
||||
|
||||
private static bool Test(int recurseLevel)
|
||||
{
|
||||
if (s_globalFlag2 = !s_globalFlag2)
|
||||
return TestTryCatch(recurseLevel);
|
||||
else
|
||||
return TestTryFinally(recurseLevel);
|
||||
}
|
||||
|
||||
private static int Main()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (TestTryCatch(15) || !TestTryCatch(18))
|
||||
{
|
||||
Console.WriteLine("try...catch test failed.");
|
||||
return 1;
|
||||
}
|
||||
if (TestTryFinally(19) || !TestTryFinally(12))
|
||||
{
|
||||
Console.WriteLine("try...finally test failed.");
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
Console.WriteLine("Failed w/ exception");
|
||||
return -1;
|
||||
}
|
||||
Console.WriteLine("Passed");
|
||||
return 100;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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>
|
|
@ -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>
|
|
@ -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>
|
|
@ -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>
|
|
@ -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>
|
|
@ -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>
|
|
@ -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;
|
||||
|
||||
namespace Test
|
||||
{
|
||||
internal class Base
|
||||
{
|
||||
public double m;
|
||||
public Base() { m = 1.0; }
|
||||
|
||||
public virtual Base[] Clone(int numOfCopies)
|
||||
{
|
||||
Base[] arr = new Base[numOfCopies];
|
||||
for (int L = 0; L < numOfCopies; L++)
|
||||
arr[L] = new Base();
|
||||
return arr;
|
||||
}
|
||||
}
|
||||
|
||||
internal class Derived : Base
|
||||
{
|
||||
public Derived() { m = 2.0; }
|
||||
|
||||
public override Base[] Clone(int numOfCopies)
|
||||
{
|
||||
Derived[] arr = new Derived[numOfCopies];
|
||||
for (int L = 0; L < numOfCopies; L++)
|
||||
arr[L] = new Derived();
|
||||
return arr;
|
||||
}
|
||||
|
||||
private static int Main()
|
||||
{
|
||||
Base bas = new Derived();
|
||||
bas = bas.Clone(11)[10];
|
||||
if (bas.m != 2.0)
|
||||
{
|
||||
Console.WriteLine("FAILED");
|
||||
return 1;
|
||||
}
|
||||
Derived derived = (Derived)bas;
|
||||
bas = derived.Clone(11)[10];
|
||||
if (bas.m != 2.0)
|
||||
{
|
||||
Console.WriteLine("FAILED");
|
||||
return 1;
|
||||
}
|
||||
Console.WriteLine("PASSED");
|
||||
return 100;
|
||||
}
|
||||
}
|
||||
}
|
27
src/coreclr/tests/src/JIT/Methodical/Invoke/ctor/app.config
Normal file
27
src/coreclr/tests/src/JIT/Methodical/Invoke/ctor/app.config
Normal file
|
@ -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>
|
|
@ -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>
|
19
src/coreclr/tests/src/JIT/Methodical/Invoke/ctor/ctor.csproj
Normal file
19
src/coreclr/tests/src/JIT/Methodical/Invoke/ctor/ctor.csproj
Normal file
|
@ -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>
|
|
@ -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>
|
45
src/coreclr/tests/src/JIT/Methodical/Invoke/ctor/val_ctor.cs
Normal file
45
src/coreclr/tests/src/JIT/Methodical/Invoke/ctor/val_ctor.cs
Normal file
|
@ -0,0 +1,45 @@
|
|||
// 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 JitTest
|
||||
{
|
||||
internal struct TestStruct
|
||||
{
|
||||
private long _m_testParam;
|
||||
private static long s_m_sum = 0;
|
||||
|
||||
private TestStruct(ulong testParam)
|
||||
{
|
||||
_m_testParam = (long)testParam;
|
||||
s_m_sum += _m_testParam;
|
||||
if (s_m_sum < 100)
|
||||
{
|
||||
//In IL, this will be changed to newobj
|
||||
TestStruct ts = new TestStruct(testParam + 1);
|
||||
}
|
||||
}
|
||||
|
||||
private static int Main()
|
||||
{
|
||||
try
|
||||
{
|
||||
//In IL, this will be changed to newobj
|
||||
TestStruct test = new TestStruct(0);
|
||||
if (s_m_sum != 105)
|
||||
{
|
||||
Console.WriteLine("Failed");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
Console.WriteLine("Failed w/ exception");
|
||||
return 2;
|
||||
}
|
||||
Console.WriteLine("Passed");
|
||||
return 100;
|
||||
}
|
||||
}
|
||||
}
|
27
src/coreclr/tests/src/JIT/Methodical/Invoke/deep/app.config
Normal file
27
src/coreclr/tests/src/JIT/Methodical/Invoke/deep/app.config
Normal file
|
@ -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>
|
|
@ -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>
|
146
src/coreclr/tests/src/JIT/Methodical/Invoke/deep/deep.cs
Normal file
146
src/coreclr/tests/src/JIT/Methodical/Invoke/deep/deep.cs
Normal file
|
@ -0,0 +1,146 @@
|
|||
// 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 JitTest
|
||||
{
|
||||
internal class Test
|
||||
{
|
||||
private static double[] Method(double arg1, float arg2, ref double refarg)
|
||||
{
|
||||
double[] ret = new double[4];
|
||||
if (arg1 < 11.0)
|
||||
{
|
||||
ret[0] = arg1 + Method(arg1 + 1.0, arg2, ref refarg)[0];
|
||||
ret[1] = arg2 + Method(arg1 + 2.0, arg2, ref ret[0])[1];
|
||||
ret[2] = arg1 + arg2 + Method(arg1 + 3.0, arg2, ref ret[1])[2];
|
||||
ret[3] = arg1 + arg2 * 2 + Method(arg1 + 4.0, arg2, ref ret[2])[3];
|
||||
}
|
||||
refarg += 1.0d;
|
||||
return ret;
|
||||
}
|
||||
|
||||
private static double Method2(double arg1, int arg2, double refarg)
|
||||
{
|
||||
double[] ret = new double[4];
|
||||
if (arg1 < 11.0)
|
||||
{
|
||||
ret[0] = arg1 + Method2(arg1 + 1.0, arg2, refarg);
|
||||
ret[1] = arg2 + Method2(arg1 + 2.0, arg2, ret[0]);
|
||||
ret[2] = arg1 + arg2 + Method2(arg1 + 3.0, arg2, ret[1]);
|
||||
ret[3] = arg1 + arg2 * 2 + Method2(arg1 + 4.0, arg2, ret[2]);
|
||||
}
|
||||
return ret[0] + ret[1] + ret[2] + ret[3];
|
||||
}
|
||||
|
||||
private static int Main()
|
||||
{
|
||||
try
|
||||
{
|
||||
double L = -1.0;
|
||||
if (Method(0.0d, 1.0f, ref L)[3] != 18.0)
|
||||
throw new Exception();
|
||||
|
||||
L = Method2(
|
||||
|
||||
Method(0.0d, 0.0f, ref
|
||||
Method(1.0d, 0.0f, ref
|
||||
Method(2.0d, 0.0f, ref
|
||||
Method(3.0d, 0.0f, ref
|
||||
Method(4.0d, 0.0f, ref
|
||||
Method(5.0d, 0.0f, ref
|
||||
Method(6.0d, 0.0f, ref
|
||||
Method(7.0d, 0.0f, ref
|
||||
Method(8.0d, 0.0f, ref
|
||||
Method(9.0d, 0.0f, ref
|
||||
Method(0.0d, 1.0f, ref
|
||||
Method(0.0d, 2.0f, ref
|
||||
Method(0.0d, 3.0f, ref
|
||||
Method(0.0d, 4.0f, ref
|
||||
Method(0.0d, 5.0f, ref
|
||||
Method(0.0d, 6.0f, ref
|
||||
Method(0.0d, 7.0f, ref
|
||||
Method(0.0d, 8.0f, ref
|
||||
Method(0.0d, 9.0f, ref
|
||||
Method(0.0d, 10.0f, ref
|
||||
Method(0.0d, 11.0f, ref
|
||||
Method(0.0d, 12.0f, ref L
|
||||
)[1]
|
||||
)[2]
|
||||
)[3]
|
||||
)[0]
|
||||
)[1]
|
||||
)[2]
|
||||
)[3]
|
||||
)[2]
|
||||
)[1]
|
||||
)[0]
|
||||
)[0]
|
||||
)[1]
|
||||
)[2]
|
||||
)[2]
|
||||
)[3]
|
||||
)[2]
|
||||
)[1]
|
||||
)[0]
|
||||
)[1]
|
||||
)[1]
|
||||
)[1]
|
||||
)[1]
|
||||
|
||||
, 0,
|
||||
Method2(1.0d, 0,
|
||||
Method2(2.0d, 0,
|
||||
Method2(3.0d, 0,
|
||||
Method2(4.0d, 0,
|
||||
Method2(5.0d, 0,
|
||||
Method2(6.0d, 0,
|
||||
Method2(7.0d, 0,
|
||||
Method2(8.0d, 0,
|
||||
Method2(9.0d, 0,
|
||||
Method2(0.0d, 1,
|
||||
Method2(0.0d, 2,
|
||||
Method2(0.0d, 3,
|
||||
Method2(0.0d, 4,
|
||||
Method2(0.0d, 5,
|
||||
Method2(0.0d, 6,
|
||||
Method2(0.0d, 7,
|
||||
Method2(0.0d, 8,
|
||||
Method2(0.0d, 9,
|
||||
Method2(0.0d, 10,
|
||||
Method2(0.0d, 11,
|
||||
Method2(0.0d, 12, L
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
catch
|
||||
{
|
||||
Console.WriteLine("Failed w/ exception");
|
||||
return 1;
|
||||
}
|
||||
Console.WriteLine("Passed");
|
||||
return 100;
|
||||
}
|
||||
}
|
||||
}
|
19
src/coreclr/tests/src/JIT/Methodical/Invoke/deep/deep.csproj
Normal file
19
src/coreclr/tests/src/JIT/Methodical/Invoke/deep/deep.csproj
Normal file
|
@ -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>
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue