Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
Merge pull request #738 from libengu/AddJITCSETests
Browse files Browse the repository at this point in the history
Add JIT CSE tests
  • Loading branch information
Bengu Li committed Apr 18, 2015
2 parents 1987adb + 776cfa1 commit 7fb0805
Show file tree
Hide file tree
Showing 30 changed files with 227,182 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/src/AllTestProjects.sln
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "misc", "JIT\jit64\gc\misc\m
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "vswhidbey", "JIT\jit64\gc\regress\vswhidbey\vswhidbey.csproj", "{4F79D631-9938-4DB0-A483-8EEA0F531D51}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "opt", "opt", "{3B576AFC-FF4F-4C40-81BF-465767683FB9}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "cse", "cse", "{816A193E-2D3A-4E4B-80FB-C9C322281F53}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "cse", "JIT\jit64\opt\cse\cse.csproj", "{D63841EE-5F9D-4089-A9F6-D1D04DD30B78}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -299,6 +305,16 @@ Global
{4F79D631-9938-4DB0-A483-8EEA0F531D51}.Release|Mixed Platforms.Build.0 = Release|x64
{4F79D631-9938-4DB0-A483-8EEA0F531D51}.Release|x64.ActiveCfg = Release|x64
{4F79D631-9938-4DB0-A483-8EEA0F531D51}.Release|x64.Build.0 = Release|x64
{D63841EE-5F9D-4089-A9F6-D1D04DD30B78}.Debug|Any CPU.ActiveCfg = Debug|x64
{D63841EE-5F9D-4089-A9F6-D1D04DD30B78}.Debug|Mixed Platforms.ActiveCfg = Debug|x64
{D63841EE-5F9D-4089-A9F6-D1D04DD30B78}.Debug|Mixed Platforms.Build.0 = Debug|x64
{D63841EE-5F9D-4089-A9F6-D1D04DD30B78}.Debug|x64.ActiveCfg = Debug|x64
{D63841EE-5F9D-4089-A9F6-D1D04DD30B78}.Debug|x64.Build.0 = Debug|x64
{D63841EE-5F9D-4089-A9F6-D1D04DD30B78}.Release|Any CPU.ActiveCfg = Release|x64
{D63841EE-5F9D-4089-A9F6-D1D04DD30B78}.Release|Mixed Platforms.ActiveCfg = Release|x64
{D63841EE-5F9D-4089-A9F6-D1D04DD30B78}.Release|Mixed Platforms.Build.0 = Release|x64
{D63841EE-5F9D-4089-A9F6-D1D04DD30B78}.Release|x64.ActiveCfg = Release|x64
{D63841EE-5F9D-4089-A9F6-D1D04DD30B78}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -339,10 +355,13 @@ Global
{6B543CA2-10A2-4771-9F93-1733AA7A2DB8} = {1E0A9AAE-133F-4881-8DC6-571F12B96B8B}
{39DD9A75-2535-4EBD-94A4-C7DF7EF12CF5} = {6B543CA2-10A2-4771-9F93-1733AA7A2DB8}
{BD5A2705-2A6A-46A5-8EB1-8F4682B6B025} = {D9FFDA0F-00A2-458C-B3D3-77D0811E969E}
{3B576AFC-FF4F-4C40-81BF-465767683FB9} = {D9FFDA0F-00A2-458C-B3D3-77D0811E969E}
{17842328-DBEB-4209-BAE6-512FCA163DC5} = {BD5A2705-2A6A-46A5-8EB1-8F4682B6B025}
{76DA480B-E2C8-4BE7-B012-3F89384C3184} = {BD5A2705-2A6A-46A5-8EB1-8F4682B6B025}
{C4BADAC7-40D0-4C0B-9A4C-DEDC9F6BFB6E} = {17842328-DBEB-4209-BAE6-512FCA163DC5}
{EDC4C742-D1C9-419B-A37D-3C687371F931} = {76DA480B-E2C8-4BE7-B012-3F89384C3184}
{4F79D631-9938-4DB0-A483-8EEA0F531D51} = {EDC4C742-D1C9-419B-A37D-3C687371F931}
{816A193E-2D3A-4E4B-80FB-C9C322281F53} = {3B576AFC-FF4F-4C40-81BF-465767683FB9}
{D63841EE-5F9D-4089-A9F6-D1D04DD30B78} = {816A193E-2D3A-4E4B-80FB-C9C322281F53}
EndGlobalSection
EndGlobal
3,528 changes: 3,528 additions & 0 deletions tests/src/JIT/jit64/opt/cse/HugeArray.cs

Large diffs are not rendered by default.

85,508 changes: 85,508 additions & 0 deletions tests/src/JIT/jit64/opt/cse/HugeArray1.cs

Large diffs are not rendered by default.

12,283 changes: 12,283 additions & 0 deletions tests/src/JIT/jit64/opt/cse/HugeField1.cs

Large diffs are not rendered by default.

12,279 changes: 12,279 additions & 0 deletions tests/src/JIT/jit64/opt/cse/HugeField2.cs

Large diffs are not rendered by default.

27 changes: 27 additions & 0 deletions tests/src/JIT/jit64/opt/cse/app.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.20.0" newVersion="4.0.20.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Text.Encoding" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.IO" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Reflection" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
230 changes: 230 additions & 0 deletions tests/src/JIT/jit64/opt/cse/arrayexpr1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,230 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//

//((a[0]+a[2])+a[1])
//permutations for ((a[0]+a[2])+a[1])
//((a[0]+a[2])+a[1])
//(a[1]+(a[0]+a[2]))
//(a[0]+a[2])
//(a[2]+a[0])
//a[0]
//a[2]
//(a[2]+a[0])
//(a[0]+a[2])
//a[1]
//(a[0]+(a[2]+a[1]))
//(a[2]+(a[0]+a[1]))
//(a[2]+a[1])
//(a[1]+a[2])
//a[2]
//a[1]
//(a[1]+a[2])
//(a[2]+a[1])
//(a[0]+a[1])
//(a[1]+a[0])
//a[0]
//a[1]
//(a[1]+a[0])
//(a[0]+a[1])
//(a[1]+(a[0]+a[2]))
//((a[0]+a[2])+a[1])
namespace CseTest
{
using System;

public class Test_Main
{
static int Main()
{
int ret = 100;
int[] a = new int[5];

a[0] = return_int(false, -69);
a[2] = return_int(false, 15);
a[1] = return_int(false, -17);

int v;

#if LOOP
do {
#endif
v = ((a[0] + a[2]) + a[1]);
if (v != -71)
{
Console.WriteLine("test0: for ((a[0]+a[2])+a[1]) failed actual value {0} ", v);
ret = ret + 1;
}
#if LOOP
for (int i = 0; i < 5; i++) {
#endif
v = (a[1] + (a[0] + a[2]));
if (v != -71)
{
Console.WriteLine("test1: for (a[1]+(a[0]+a[2])) failed actual value {0} ", v);
ret = ret + 1;
}

v = (a[0] + a[2]);
if (v != -54)
{
Console.WriteLine("test2: for (a[0]+a[2]) failed actual value {0} ", v);
ret = ret + 1;
}

v = (a[2] + a[0]);
if (v != -54)
{
Console.WriteLine("test3: for (a[2]+a[0]) failed actual value {0} ", v);
ret = ret + 1;
}

v = (a[2] + a[0]);
if (v != -54)
{
Console.WriteLine("test4: for (a[2]+a[0]) failed actual value {0} ", v);
ret = ret + 1;
}
#if LOOP
a[0] = return_int(false,-69);
}
#endif
#if TRY
try {
#endif
a[0] = return_int(false, -27);
v = (a[0] + a[2]);
if (v != -12)
{
Console.WriteLine("test5: for (a[0]+a[2]) failed actual value {0} ", v);
ret = ret + 1;
}

v = (a[0] + (a[2] + a[1]));
if (v != -29)
{
Console.WriteLine("test6: for (a[0]+(a[2]+a[1])) failed actual value {0} ", v);
ret = ret + 1;
}

v = (a[2] + (a[0] + a[1]));
if (v != -29)
{
Console.WriteLine("test7: for (a[2]+(a[0]+a[1])) failed actual value {0} ", v);
ret = ret + 1;
}

v = (a[2] + a[1]);
if (v != -2)
{
Console.WriteLine("test8: for (a[2]+a[1]) failed actual value {0} ", v);
ret = ret + 1;
}

v = (a[1] + a[2]);
if (v != -2)
{
Console.WriteLine("test9: for (a[1]+a[2]) failed actual value {0} ", v);
ret = ret + 1;
}
#if TRY
} finally {
#endif

#if LOOP
for (int j = 0; j < 5; j++) {
for (int i = 0; i < 10; i++) {
#endif
v = (a[1] + a[2]);

if (v != -2)
{
Console.WriteLine(a[1] + " " + a[2]);
Console.WriteLine("test10: for (a[1]+a[2]) failed actual value {0} ", v);
ret = ret + 1;
}

v = (a[2] + a[1]);
if (v != -2)
{
Console.WriteLine("test11: for (a[2]+a[1]) failed actual value {0} ", v);
ret = ret + 1;
}

a[2] = return_int(false, -105);
v = (a[0] + a[1]);
if (v != -44)
{
Console.WriteLine("test12: for (a[0]+a[1]) failed actual value {0} ", v);
ret = ret + 1;
}

v = (a[1] + a[0]);
if (v != -44)
{
Console.WriteLine("test13: for (a[1]+a[0]) failed actual value {0} ", v);
ret = ret + 1;
}
#if LOOP
a[2] = return_int(false, 15);
}
a[1] = return_int(false, -17);
}
#endif
a[2] = return_int(false, -105);

v = (a[1] + a[0]);
if (v != -44)
{
Console.WriteLine("test14: for (a[1]+a[0]) failed actual value {0} ", v);
ret = ret + 1;
}
#if TRY
}
#endif
v = (a[0] + a[1]);
if (v != -44)
{
Console.WriteLine("test15: for (a[0]+a[1]) failed actual value {0} ", v);
ret = ret + 1;
}

v = (a[1] + (a[0] + a[2]));
if (v != -149)
{
Console.WriteLine("test16: for (a[1]+(a[0]+a[2])) failed actual value {0} ", v);
ret = ret + 1;
}

v = ((a[0] + a[2]) + a[1]);
if (v != -149)
{
Console.WriteLine("test17: for ((a[0]+a[2])+a[1]) failed actual value {0} ", v);
ret = ret + 1;
}
#if LOOP
} while (v==0);
#endif
Console.WriteLine(ret);
return ret;
}
private static int return_int(bool verbose, int input)
{
int ans;

try
{
ans = input;
}
finally
{
if (verbose)
{
Console.WriteLine("returning : ans");
}
}
return ans;
}
}
}

Loading

0 comments on commit 7fb0805

Please sign in to comment.