summaryrefslogtreecommitdiff
path: root/tests/src/JIT/Methodical/xxobj/operand
diff options
context:
space:
mode:
authorPat Gavlin <pagavlin@microsoft.com>2015-05-21 10:41:53 -0700
committerPat Gavlin <pagavlin@microsoft.com>2015-05-21 12:51:41 -0700
commit66060eef4e3b684f5e120097e459b6135d1ceb21 (patch)
treeaf58ab6e3b52da36153a215d387f91afe6fe1ee8 /tests/src/JIT/Methodical/xxobj/operand
parent8e792a35f8327a56c4676360c92b8b9952303888 (diff)
downloadcoreclr-66060eef4e3b684f5e120097e459b6135d1ceb21.tar.gz
coreclr-66060eef4e3b684f5e120097e459b6135d1ceb21.tar.bz2
coreclr-66060eef4e3b684f5e120097e459b6135d1ceb21.zip
Import more JIT tests.
This imports the remainder of the tests under JIT\Methodical that are able to target CoreCLR. This also contains build fixes for tests under JIT\Directed\coverage\oldtests that were mangled during a previous import.
Diffstat (limited to 'tests/src/JIT/Methodical/xxobj/operand')
-rw-r--r--tests/src/JIT/Methodical/xxobj/operand/app.config27
-rw-r--r--tests/src/JIT/Methodical/xxobj/operand/cs_template.proj43
-rw-r--r--tests/src/JIT/Methodical/xxobj/operand/operand.csproj19
-rw-r--r--tests/src/JIT/Methodical/xxobj/operand/packages.config3
-rw-r--r--tests/src/JIT/Methodical/xxobj/operand/refanyval.cs70
-rw-r--r--tests/src/JIT/Methodical/xxobj/operand/unbox.cs70
6 files changed, 232 insertions, 0 deletions
diff --git a/tests/src/JIT/Methodical/xxobj/operand/app.config b/tests/src/JIT/Methodical/xxobj/operand/app.config
new file mode 100644
index 0000000000..8077c95440
--- /dev/null
+++ b/tests/src/JIT/Methodical/xxobj/operand/app.config
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+ <runtime>
+ <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+ <dependentAssembly>
+ <assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-4.0.20.0" newVersion="4.0.20.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.Text.Encoding" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.IO" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.Reflection" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
+ </dependentAssembly>
+ </assemblyBinding>
+ </runtime>
+</configuration> \ No newline at end of file
diff --git a/tests/src/JIT/Methodical/xxobj/operand/cs_template.proj b/tests/src/JIT/Methodical/xxobj/operand/cs_template.proj
new file mode 100644
index 0000000000..dccc73f647
--- /dev/null
+++ b/tests/src/JIT/Methodical/xxobj/operand/cs_template.proj
@@ -0,0 +1,43 @@
+<?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>
+ <LinkLocalMscorlib>true</LinkLocalMscorlib>
+ </PropertyGroup>
+ <!-- Default configurations to help VS understand the configurations -->
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ </PropertyGroup>
+ <ItemGroup>
+ <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+ <Visible>False</Visible>
+ </CodeAnalysisDependentAssemblyPaths>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="$(AssemblyName1).cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="packages.config" />
+ <None Include="app.config" />
+ </ItemGroup>
+ <ItemGroup>
+ <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+ </ItemGroup>
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+ <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+ </PropertyGroup>
+</Project>
diff --git a/tests/src/JIT/Methodical/xxobj/operand/operand.csproj b/tests/src/JIT/Methodical/xxobj/operand/operand.csproj
new file mode 100644
index 0000000000..6f3522c9ed
--- /dev/null
+++ b/tests/src/JIT/Methodical/xxobj/operand/operand.csproj
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+ <!-- Default configurations to help VS understand the configurations -->
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
+ </PropertyGroup>
+ <Target Name="Build">
+ <ItemGroup>
+ <AllSourceFiles Include="$(MSBuildProjectDirectory)\*.cs" />
+ </ItemGroup>
+ <PropertyGroup>
+ <GenerateRunScript>false</GenerateRunScript>
+ </PropertyGroup>
+ <MSBuild Projects="cs_template.proj" Properties="AssemblyName1=%(AllSourceFiles.FileName);AllowUnsafeBlocks=True;IntermediateOutputPath=$(IntermediateOutputPath)\%(AllSourceFiles.FileName)\" />
+ </Target>
+</Project> \ No newline at end of file
diff --git a/tests/src/JIT/Methodical/xxobj/operand/packages.config b/tests/src/JIT/Methodical/xxobj/operand/packages.config
new file mode 100644
index 0000000000..79ece06bef
--- /dev/null
+++ b/tests/src/JIT/Methodical/xxobj/operand/packages.config
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+</packages>
diff --git a/tests/src/JIT/Methodical/xxobj/operand/refanyval.cs b/tests/src/JIT/Methodical/xxobj/operand/refanyval.cs
new file mode 100644
index 0000000000..af7cecab48
--- /dev/null
+++ b/tests/src/JIT/Methodical/xxobj/operand/refanyval.cs
@@ -0,0 +1,70 @@
+// 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 Test
+ {
+ private int _m_v;
+
+ private static int refanyval_ldobj()
+ {
+ Test T = new Test();
+ T._m_v = 1;
+ TypedReference R = __makeref(T);
+ return __refvalue(R, Test)._m_v - 1;
+ }
+
+ private static int refanyval_initobj()
+ {
+ Test T = new Test();
+ T._m_v = 1;
+ TypedReference R = __makeref(T);
+ __refvalue(R, Test) = new Test();
+ return T._m_v;
+ }
+
+ private static int refanyval_cpobj()
+ {
+ Test T = new Test();
+ T._m_v = 1;
+ Test T1 = new Test();
+ TypedReference R = __makeref(T); //replace with cpobj in IL
+ __refvalue(R, Test) = T1;
+ return T._m_v;
+ }
+
+ private static int refanyval_stobj()
+ {
+ Test T = new Test();
+ T._m_v = 1;
+ Test T1 = new Test();
+ TypedReference R = __makeref(T);
+ __refvalue(R, Test) = T1;
+ return T._m_v;
+ }
+
+ private static int Main()
+ {
+ if (refanyval_ldobj() != 0)
+ {
+ return 101;
+ }
+ if (refanyval_initobj() != 0)
+ {
+ return 102;
+ }
+ if (refanyval_stobj() != 0)
+ {
+ return 103;
+ }
+ if (refanyval_cpobj() != 0)
+ {
+ return 104;
+ }
+ return 100;
+ }
+ }
+}
diff --git a/tests/src/JIT/Methodical/xxobj/operand/unbox.cs b/tests/src/JIT/Methodical/xxobj/operand/unbox.cs
new file mode 100644
index 0000000000..24d07b35d6
--- /dev/null
+++ b/tests/src/JIT/Methodical/xxobj/operand/unbox.cs
@@ -0,0 +1,70 @@
+// 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 Test
+ {
+ private int _m_v;
+
+ private static int unbox_ldobj()
+ {
+ Test T = new Test();
+ T._m_v = 1;
+ object R = T;
+ return ((Test)R)._m_v - 1;
+ }
+
+ private static int unbox_initobj()
+ {
+ Test T = new Test();
+ T._m_v = 1;
+ object R = T;
+ R = new Test(); //change to unbox<R> = new Test() in IL
+ return ((Test)R)._m_v;
+ }
+
+ private static int unbox_cpobj()
+ {
+ Test T = new Test();
+ T._m_v = 1;
+ Test T1 = new Test();
+ object R = T;
+ R = T1; //change to unbox<R> = T1 in IL
+ return ((Test)R)._m_v;
+ }
+
+ private static int unbox_stobj()
+ {
+ Test T = new Test();
+ T._m_v = 1;
+ Test T1 = new Test();
+ object R = T;
+ R = T1; //change to unbox<R> = T1 in IL
+ return ((Test)R)._m_v;
+ }
+
+ private static int Main()
+ {
+ if (unbox_ldobj() != 0)
+ {
+ return 101;
+ }
+ if (unbox_initobj() != 0)
+ {
+ return 102;
+ }
+ if (unbox_stobj() != 0)
+ {
+ return 103;
+ }
+ if (unbox_cpobj() != 0)
+ {
+ return 104;
+ }
+ return 100;
+ }
+ }
+}