diff options
Diffstat (limited to 'tests')
17 files changed, 1020 insertions, 0 deletions
diff --git a/tests/src/JIT/Methodical/eh/deadcode/deadcodeincatch.il b/tests/src/JIT/Methodical/eh/deadcode/deadcodeincatch.il new file mode 100644 index 0000000000..3190aba115 --- /dev/null +++ b/tests/src/JIT/Methodical/eh/deadcode/deadcodeincatch.il @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +.assembly extern mscorlib +{ + .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4.. + .ver 1:0:3300:0 +} +.assembly extern System.Console +{ + .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) + .ver 4:0:0:0 +} +.assembly extern common {} +.assembly trycatch +{ + // --- The following custom attribute is added automatically, do not uncomment ------- + // .custom instance void [mscorlib]System.Diagnostics.DebuggableAttribute::.ctor(bool, + // bool) = ( 01 00 00 01 00 00 ) + .hash algorithm 0x00008004 + .ver 0:0:0:0 +} +.module trycatch.exe +// MVID: {3B8B6D1B-A317-4591-BD66-1D1000E3767F} +.imagebase 0x00400000 +.subsystem 0x00000003 +.file alignment 512 +.corflags 0x00000001 +// Image base: 0x03010000 +// +// ============== CLASS STRUCTURE DECLARATION ================== +// +.namespace hello +{ + .class private auto ansi beforefieldinit Class1 + extends [mscorlib]System.Object + { + .field private static class [common]TestUtil.TestLog testLog + .method private hidebysig specialname rtspecialname static void .cctor() cil managed + { + .maxstack 3 + .locals init (class [mscorlib]System.IO.StringWriter expectedOut) + newobj instance void [mscorlib]System.IO.StringWriter::.ctor() + stloc.s expectedOut + ldloc.s expectedOut + ldstr "In try" + callvirt instance void [mscorlib]System.IO.TextWriter::WriteLine(string) + ldloc.s expectedOut + ldstr "In catch" + callvirt instance void [mscorlib]System.IO.TextWriter::WriteLine(string) + ldloc.s expectedOut + ldstr "hello" + callvirt instance void [mscorlib]System.IO.TextWriter::WriteLine(string) + ldloc.s expectedOut + ldstr "In finally" + callvirt instance void [mscorlib]System.IO.TextWriter::WriteLine(string) + ldloc.s expectedOut + ldstr "Pass" + callvirt instance void [mscorlib]System.IO.TextWriter::WriteLine(string) + ldloc.s expectedOut + newobj instance void [common]TestUtil.TestLog::.ctor(object) + stsfld class [common]TestUtil.TestLog hello.Class1::testLog + ret + } // end of method Class1::.cctor + + } // end of class Class1 + +} // end of namespace hello + + +// ============================================================= + + +// =============== GLOBAL FIELDS AND METHODS =================== + + +// ============================================================= + + +// =============== CLASS MEMBERS DECLARATION =================== +// note that class flags, 'extends' and 'implements' clauses +// are provided here for information only + +.namespace hello +{ + .class private auto ansi beforefieldinit Class1 + extends [mscorlib]System.Object + { + .method public hidebysig static void + inTry() cil managed + { + // Code size 11 (0xb) + .maxstack 1 + IL_0000: ldstr "In try" + IL_0005: call void [System.Console]System.Console::WriteLine(string) + IL_000a: ret + } // end of method Class1::inTry + + .method public hidebysig static void + inCatch() cil managed + { + // Code size 11 (0xb) + .maxstack 1 + IL_0000: ldstr "In catch" + IL_0005: call void [System.Console]System.Console::WriteLine(string) + IL_000a: ret + } // end of method Class1::inCatch + + .method public hidebysig static void + inFinally() cil managed + { + // Code size 1 (0x1) + .maxstack 0 + IL_0000: ret + } // end of method Class1::inFinally + + .method public hidebysig static int32 + Main(string[] args) cil managed + { + .entrypoint + .maxstack 1 + ldstr "hello" + call int32 hello.Class1::Run(string) + ret + } + + .method public hidebysig static int32 + Run(string arg) cil managed + { + // Code size 74 (0x4a) + .maxstack 2 + .locals init (string V_0, + class [mscorlib]System.Exception V_1, + string V_2, + int32 V_3) + + starttest: + // Start recording + ldsfld class [common]TestUtil.TestLog hello.Class1::testLog + callvirt instance void [common]TestUtil.TestLog::StartRecording() + ldarg.0 + stloc.0 + .try + { + call void hello.Class1::inTry() + newobj instance void [mscorlib]System.Exception::.ctor() + throw + leave.s done + + } // end .try + catch [mscorlib]System.Exception + { + stloc.1 + .try + { + + ldstr "Hello" + ldloc.0 + call string [mscorlib]System.String::Concat(string, + string) + stloc.2 + call void hello.Class1::inCatch() + ldloc.0 + call void [System.Console]System.Console::WriteLine(string) + + br.s donetry + + ldloc.0 + callvirt instance int32 [mscorlib]System.String::get_Length() + ldc.i4.2 + blt.s donetry + + ldloc.2 + call void [System.Console]System.Console::WriteLine(string) + + donetry: + leave.s donecatch + } finally { + ldstr "In finally" + call void [System.Console]System.Console::WriteLine(string) + endfinally + } + donecatch: + leave.s doneok + } // end handler + doneok: + ldstr "Pass" + call void [System.Console]System.Console::WriteLine(string) + + // stop recoding + ldsfld class [common]TestUtil.TestLog hello.Class1::testLog + callvirt instance void [common]TestUtil.TestLog::StopRecording() + + // verify output + ldsfld class [common]TestUtil.TestLog hello.Class1::testLog + callvirt instance int32 [common]TestUtil.TestLog::VerifyOutput() + stloc.3 + done: + ldloc.3 + ret + } // end of method Class1::Main + + .method public hidebysig specialname rtspecialname + instance void .ctor() cil managed + { + // Code size 7 (0x7) + .maxstack 1 + IL_0000: ldarg.0 + IL_0001: call instance void [mscorlib]System.Object::.ctor() + IL_0006: ret + } // end of method Class1::.ctor + + } // end of class Class1 + + +// ============================================================= + +} // end of namespace hello + +//*********** DISASSEMBLY COMPLETE *********************** +// WARNING: Created Win32 resource file deadcodeincatch.res diff --git a/tests/src/JIT/Methodical/eh/deadcode/deadcodeincatch_d.ilproj b/tests/src/JIT/Methodical/eh/deadcode/deadcodeincatch_d.ilproj new file mode 100644 index 0000000000..0f1159dd86 --- /dev/null +++ b/tests/src/JIT/Methodical/eh/deadcode/deadcodeincatch_d.ilproj @@ -0,0 +1,52 @@ +<?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>$(MSBuildProjectName)</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> + <PropertyGroup> + <DebugType>Full</DebugType> + </PropertyGroup> + <ItemGroup> + <Compile Include="deadcodeincatch.il" /> + </ItemGroup> + <ItemGroup> + <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" /> + <None Include="app.config" /> + </ItemGroup> + <ItemGroup> + <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" /> + </ItemGroup> + <PropertyGroup> + <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson> + <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson> + </PropertyGroup> + <ItemGroup> + <ProjectReference Include="..\common\common.csproj" /> + </ItemGroup> + <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" /> + <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "> + </PropertyGroup> +</Project> diff --git a/tests/src/JIT/Methodical/eh/deadcode/deadcodeincatch_r.ilproj b/tests/src/JIT/Methodical/eh/deadcode/deadcodeincatch_r.ilproj new file mode 100644 index 0000000000..f482745215 --- /dev/null +++ b/tests/src/JIT/Methodical/eh/deadcode/deadcodeincatch_r.ilproj @@ -0,0 +1,52 @@ +<?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>$(MSBuildProjectName)</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> + <PropertyGroup> + <DebugType></DebugType> + </PropertyGroup> + <ItemGroup> + <Compile Include="deadcodeincatch.il" /> + </ItemGroup> + <ItemGroup> + <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" /> + <None Include="app.config" /> + </ItemGroup> + <ItemGroup> + <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" /> + </ItemGroup> + <PropertyGroup> + <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson> + <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson> + </PropertyGroup> + <ItemGroup> + <ProjectReference Include="..\common\common.csproj" /> + </ItemGroup> + <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" /> + <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "> + </PropertyGroup> +</Project> diff --git a/tests/src/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b12795/app.config b/tests/src/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b12795/app.config new file mode 100644 index 0000000000..62803f5972 --- /dev/null +++ b/tests/src/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b12795/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/Regression/CLR-x86-JIT/V1-M09.5-PDC/b12795/b12795.cs b/tests/src/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b12795/b12795.cs new file mode 100644 index 0000000000..6bd6870f9e --- /dev/null +++ b/tests/src/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b12795/b12795.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +namespace DefaultNamespace +{ + using System; + + internal class NStructTun + { + public static int Main() + { + Mainy(); + GC.Collect(); + GC.WaitForPendingFinalizers(); + GC.Collect(); + Console.Out.WriteLine(STRMAP.icFinal + " finalized."); + return 100; + } + + public static void Mainy() + { + try + { + } + catch (Exception) + { + } + + STRMAP Strmap; + Strmap = new STRMAP(); + Strmap = new STRMAP(); + Strmap = null; + + GC.Collect(); + GC.WaitForPendingFinalizers(); + GC.Collect(); + Console.Out.WriteLine(STRMAP.icFinal + " finalized."); + } + } + + class STRMAP + { + internal static int icFinal = 0; + ~STRMAP() + { + STRMAP.icFinal++; + } + } +} diff --git a/tests/src/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b12795/b12795.csproj b/tests/src/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b12795/b12795.csproj new file mode 100644 index 0000000000..665d95e178 --- /dev/null +++ b/tests/src/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b12795/b12795.csproj @@ -0,0 +1,49 @@ +<?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>$(MSBuildProjectName)</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> + + <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> + <PropertyGroup> + <DebugType></DebugType> + </PropertyGroup> + <ItemGroup> + <Compile Include="b12795.cs" /> + </ItemGroup> + <ItemGroup> + <None Include="$(JitPackagesConfigFileDirectory)threading+thread\project.json" /> + <None Include="app.config" /> + </ItemGroup> + <ItemGroup> + <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" /> + </ItemGroup> + <PropertyGroup> + <ProjectJson>$(JitPackagesConfigFileDirectory)threading+thread\project.json</ProjectJson> + <ProjectLockJson>$(JitPackagesConfigFileDirectory)threading+thread\project.lock.json</ProjectLockJson> + </PropertyGroup> + <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" /> + <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "> + </PropertyGroup> +</Project> diff --git a/tests/src/JIT/jit64/mcc/interop/CMakeLists.txt b/tests/src/JIT/jit64/mcc/interop/CMakeLists.txt index 9cde088bc7..0e4219949d 100644 --- a/tests/src/JIT/jit64/mcc/interop/CMakeLists.txt +++ b/tests/src/JIT/jit64/mcc/interop/CMakeLists.txt @@ -4,6 +4,7 @@ project(mcc_native) set(CMAKE_SHARED_LIBRARY_PREFIX "") add_library(native_i0c SHARED native_i0c.cpp) +add_library(native_i1c SHARED native_i1c.cpp) add_library(native_i3c SHARED native_i3c.cpp) add_library(native_i5c SHARED native_i5c.cpp) add_library(native_i6c SHARED native_i6c.cpp) @@ -22,6 +23,7 @@ add_library(native_i8s SHARED native_i8s.cpp) # add the install targets (this "installs" the native file on Windows systems) install(TARGETS native_i0c DESTINATION bin) +install(TARGETS native_i1c DESTINATION bin) install(TARGETS native_i3c DESTINATION bin) install(TARGETS native_i5c DESTINATION bin) install(TARGETS native_i6c DESTINATION bin) @@ -38,6 +40,7 @@ install(TARGETS native_i8s DESTINATION bin) # This "installs" the native file on System V systems set_target_properties(native_i0c PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/native_i0c) +set_target_properties(native_i1c PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/native_i1c) set_target_properties(native_i3c PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/native_i3c) set_target_properties(native_i5c PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/native_i5c) set_target_properties(native_i6c PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/native_i6c) diff --git a/tests/src/JIT/jit64/mcc/interop/mcc_i10.il b/tests/src/JIT/jit64/mcc/interop/mcc_i10.il new file mode 100644 index 0000000000..4fc4cab007 --- /dev/null +++ b/tests/src/JIT/jit64/mcc/interop/mcc_i10.il @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +.assembly extern mscorlib {} +.assembly MCCTest {} +.module mcc_i10.exe + + +.namespace MCCTest +{ + .class MyClass + { + .method assembly static pinvokeimpl("native_i1c" as "#1" cdecl) + vararg valuetype MCCTest.VType1 Sum(float32) cil managed preservesig { + } + + .method private static int32 Main(string[] args) + { + .entrypoint + .maxstack 64 + .locals init ( + [0] valuetype MCCTest.VType1 res, + [1] int32 rc + ) + + ldc.r8 1 + ldc.r8 2 + ldc.r8 3 + ldc.r8 4 + ldc.r8 5 + ldc.r8 6 + ldc.r8 7 + ldc.r8 8 + ldc.r8 9 + ldc.r8 10 + ldc.r8 11 + ldc.r8 12 + ldc.r8 1 + neg + call vararg valuetype MCCTest.VType1 MCCTest.MyClass::Sum(float32, ..., + float32, + float32, + float32, + float32, + float32, + float32, + float32, + float32, + float32, + float32, + float32, + float32) + + stloc.s res + + // Check Result + ldloc.s res + ldc.i4 12 + call int32 MCCTest.Common::CheckResult(valuetype MCCTest.VType1, int32) + stloc.s rc + + ldloc.s rc + ret + } // end of method MyClass::Main + + } // end of class MyClass + +} // end of namespace MCCTest diff --git a/tests/src/JIT/jit64/mcc/interop/mcc_i10.ilproj b/tests/src/JIT/jit64/mcc/interop/mcc_i10.ilproj new file mode 100644 index 0000000000..2939edb8f5 --- /dev/null +++ b/tests/src/JIT/jit64/mcc/interop/mcc_i10.ilproj @@ -0,0 +1,47 @@ +<?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>$(MSBuildProjectName)</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> + <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> + <PropertyGroup> + <DebugType>Full</DebugType> + <Optimize>False</Optimize> + </PropertyGroup> + <ItemGroup> + <Compile Include="mcc_i10.il ..\common\common.il" /> + </ItemGroup> + <ItemGroup> + <None Include="app.config" /> + </ItemGroup> + <ItemGroup> + <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="CMakeLists.txt" /> + </ItemGroup> + <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" /> + <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "> + </PropertyGroup> +</Project>
\ No newline at end of file diff --git a/tests/src/JIT/jit64/mcc/interop/mcc_i11.il b/tests/src/JIT/jit64/mcc/interop/mcc_i11.il new file mode 100644 index 0000000000..c72247c789 --- /dev/null +++ b/tests/src/JIT/jit64/mcc/interop/mcc_i11.il @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +.assembly extern mscorlib {} +.assembly MCCTest {} +.module mcc_i11.exe + + +.namespace MCCTest +{ + .class MyClass + { + .method assembly static pinvokeimpl("native_i1c.dll" as "#1" cdecl) + vararg valuetype MCCTest.VType1 Sum(float32) cil managed preservesig { + } + + .method private static int32 Main(string[] args) + { + .entrypoint + .maxstack 64 + .locals init ( + [0] valuetype MCCTest.VType1 res, + [1] int32 rc + ) + + ldc.r4 1 + ldc.r4 2 + ldc.r4 3 + ldc.r4 4 + ldc.r4 5 + ldc.r4 6 + ldc.r4 7 + ldc.r4 8 + ldc.r4 9 + ldc.r4 10 + ldc.r4 11 + ldc.r4 12 + ldc.r4 1 + neg + ldftn vararg valuetype MCCTest.VType1 MCCTest.MyClass::Sum(float32) + calli vararg valuetype MCCTest.VType1(float32, ..., + float32, + float32, + float32, + float32, + float32, + float32, + float32, + float32, + float32, + float32, + float32, + float32) + stloc.s res + + // Check Result + ldloc.s res + ldc.i4 12 + call int32 MCCTest.Common::CheckResult(valuetype MCCTest.VType1, int32) + stloc.s rc + + ldloc.s rc + ret + } // end of method MyClass::Main + + } // end of class MyClass + +} // end of namespace MCCTest diff --git a/tests/src/JIT/jit64/mcc/interop/mcc_i11.ilproj b/tests/src/JIT/jit64/mcc/interop/mcc_i11.ilproj new file mode 100644 index 0000000000..38d6e93b43 --- /dev/null +++ b/tests/src/JIT/jit64/mcc/interop/mcc_i11.ilproj @@ -0,0 +1,47 @@ +<?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>$(MSBuildProjectName)</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> + <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> + <PropertyGroup> + <DebugType>Full</DebugType> + <Optimize>False</Optimize> + </PropertyGroup> + <ItemGroup> + <Compile Include="mcc_i11.il ..\common\common.il" /> + </ItemGroup> + <ItemGroup> + <None Include="app.config" /> + </ItemGroup> + <ItemGroup> + <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="CMakeLists.txt" /> + </ItemGroup> + <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" /> + <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "> + </PropertyGroup> +</Project>
\ No newline at end of file diff --git a/tests/src/JIT/jit64/mcc/interop/mcc_i12.il b/tests/src/JIT/jit64/mcc/interop/mcc_i12.il new file mode 100644 index 0000000000..d01f4c838b --- /dev/null +++ b/tests/src/JIT/jit64/mcc/interop/mcc_i12.il @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +.assembly extern mscorlib {} +.assembly MCCTest {} +.module mcc_i12.exe + + +.namespace MCCTest +{ + .class MyClass + { + .method assembly static pinvokeimpl("native_i1c.dll" as "#1" cdecl) + vararg valuetype MCCTest.VType1 Sum(float32) cil managed preservesig { + } + + .method private valuetype MCCTest.VType1 GetSum() + { + .maxstack 64 + ldc.r4 1 + ldc.r4 2 + ldc.r4 3 + ldc.r4 4 + ldc.r4 5 + ldc.r4 6 + ldc.r4 7 + ldc.r4 8 + ldc.r4 9 + ldc.r4 10 + ldc.r4 11 + ldc.r4 12 + ldc.r4 1 + neg + tail. + call vararg valuetype MCCTest.VType1 MCCTest.MyClass::Sum(float32, ..., + float32, + float32, + float32, + float32, + float32, + float32, + float32, + float32, + float32, + float32, + float32, + float32) + ret + } + + .method public specialname rtspecialname instance void .ctor() + { + .maxstack 1 + ldarg.0 + call instance void [mscorlib]System.Object::.ctor() + ret + } // end of method MyClass::.ctor + + .method private static int32 Main(string[] args) + { + .entrypoint + .maxstack 64 + .locals init ( + [0] class MCCTest.MyClass me, + [1] valuetype MCCTest.VType1 res, + [2] int32 rc + ) + + newobj instance void MCCTest.MyClass::.ctor() + stloc.s me + + ldloc.s me + call instance valuetype MCCTest.VType1 MCCTest.MyClass::GetSum() + stloc.s res + + // Check Result + ldloc.s res + ldc.i4 12 + call int32 MCCTest.Common::CheckResult(valuetype MCCTest.VType1, int32) + stloc.s rc + + ldloc.s rc + ret + } // end of method MyClass::Main + + } // end of class MyClass + +} // end of namespace MCCTest diff --git a/tests/src/JIT/jit64/mcc/interop/mcc_i12.ilproj b/tests/src/JIT/jit64/mcc/interop/mcc_i12.ilproj new file mode 100644 index 0000000000..183ab4b4bd --- /dev/null +++ b/tests/src/JIT/jit64/mcc/interop/mcc_i12.ilproj @@ -0,0 +1,47 @@ +<?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>$(MSBuildProjectName)</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> + <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> + <PropertyGroup> + <DebugType>Full</DebugType> + <Optimize>False</Optimize> + </PropertyGroup> + <ItemGroup> + <Compile Include="mcc_i12.il ..\common\common.il" /> + </ItemGroup> + <ItemGroup> + <None Include="app.config" /> + </ItemGroup> + <ItemGroup> + <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="CMakeLists.txt" /> + </ItemGroup> + <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" /> + <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "> + </PropertyGroup> +</Project>
\ No newline at end of file diff --git a/tests/src/JIT/jit64/mcc/interop/mcc_i13.il b/tests/src/JIT/jit64/mcc/interop/mcc_i13.il new file mode 100644 index 0000000000..ff558f2f03 --- /dev/null +++ b/tests/src/JIT/jit64/mcc/interop/mcc_i13.il @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +.assembly extern mscorlib {} +.assembly MCCTest {} +.module mcc_i13.exe + + +.namespace MCCTest +{ + .class MyClass + { + .method assembly static pinvokeimpl("native_i1c.dll" as "#1" cdecl) + vararg valuetype MCCTest.VType1 Sum(float32) cil managed preservesig { + } + + .method private valuetype MCCTest.VType1 GetSum() + { + .maxstack 64 + ldc.r4 1 + ldc.r4 2 + ldc.r4 3 + ldc.r4 4 + ldc.r4 5 + ldc.r4 6 + ldc.r4 7 + ldc.r4 8 + ldc.r4 9 + ldc.r4 10 + ldc.r4 11 + ldc.r4 12 + ldc.r4 1 + neg + call vararg valuetype MCCTest.VType1 MCCTest.MyClass::GetSum2(float32, ..., + float32, + float32, + float32, + float32, + float32, + float32, + float32, + float32, + float32, + float32, + float32, + float32) + ret + } + + .method private static vararg valuetype MCCTest.VType1 GetSum2(float32) + { + jmp vararg valuetype MCCTest.VType1 MCCTest.MyClass::Sum(float32) + } + + .method public specialname rtspecialname instance void .ctor() + { + .maxstack 1 + ldarg.0 + call instance void [mscorlib]System.Object::.ctor() + ret + } // end of method MyClass::.ctor + + .method private static int32 Main(string[] args) + { + .entrypoint + .maxstack 64 + .locals init ( + [0] class MCCTest.MyClass me, + [1] valuetype MCCTest.VType1 res, + [2] int32 rc + ) + + newobj instance void MCCTest.MyClass::.ctor() + stloc.s me + + ldloc.s me + call instance valuetype MCCTest.VType1 MCCTest.MyClass::GetSum() + stloc.s res + + // Check Result + ldloc.s res + ldc.i4 12 + call int32 MCCTest.Common::CheckResult(valuetype MCCTest.VType1, int32) + stloc.s rc + + ldloc.s rc + ret + } // end of method MyClass::Main + + } // end of class MyClass + +} // end of namespace MCCTest diff --git a/tests/src/JIT/jit64/mcc/interop/mcc_i13.ilproj b/tests/src/JIT/jit64/mcc/interop/mcc_i13.ilproj new file mode 100644 index 0000000000..7bcb6ebb38 --- /dev/null +++ b/tests/src/JIT/jit64/mcc/interop/mcc_i13.ilproj @@ -0,0 +1,47 @@ +<?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>$(MSBuildProjectName)</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> + <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> + <PropertyGroup> + <DebugType>Full</DebugType> + <Optimize>False</Optimize> + </PropertyGroup> + <ItemGroup> + <Compile Include="mcc_i13.il ..\common\common.il" /> + </ItemGroup> + <ItemGroup> + <None Include="app.config" /> + </ItemGroup> + <ItemGroup> + <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="CMakeLists.txt" /> + </ItemGroup> + <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" /> + <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "> + </PropertyGroup> +</Project>
\ No newline at end of file diff --git a/tests/src/JIT/jit64/mcc/interop/native_i1c.cpp b/tests/src/JIT/jit64/mcc/interop/native_i1c.cpp new file mode 100644 index 0000000000..0edeeeffa5 --- /dev/null +++ b/tests/src/JIT/jit64/mcc/interop/native_i1c.cpp @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +#include <stdarg.h> +#include "native.h" + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wvarargs" + +MCC_API VType1 __cdecl sum(float first, ...) { + VType1 result; + + int count = 0; + float sum = 0.0; + float val = first; + va_list args; + + // initialize variable arguments. + va_start(args, first); + while (val != (float)-1) { + sum += val; + count++; + val = va_arg(args, float); + } + // reset variable arguments. + va_end(args); + + result.count = (float)count; + result.sum = sum; + result.average = result.sum / result.count; + + result.count1 = (float)count; + result.sum1 = sum; + result.average1 = result.sum1 / result.count1; + + result.count2 = (float)count; + result.sum2 = sum; + result.average2 = result.sum2 / result.count2; + + result.count3 = (float)count; + result.sum3 = sum; + result.average3 = result.sum3 / result.count3; + + result.count4 = (float)count; + result.sum4 = sum; + result.average4 = result.sum4 / result.count4; + + result.count5 = (float)count; + result.sum5 = sum; + result.average5 = result.sum5 / result.count5; + + return result; +} + +#pragma clang diagnostic pop
\ No newline at end of file diff --git a/tests/testsUnsupportedOutsideWindows.txt b/tests/testsUnsupportedOutsideWindows.txt index 2926e124a7..dedb02cfc0 100644 --- a/tests/testsUnsupportedOutsideWindows.txt +++ b/tests/testsUnsupportedOutsideWindows.txt @@ -32,6 +32,10 @@ JIT/jit64/mcc/interop/mcc_i04/mcc_i04.sh JIT/jit64/mcc/interop/mcc_i05/mcc_i05.sh JIT/jit64/mcc/interop/mcc_i06/mcc_i06.sh JIT/jit64/mcc/interop/mcc_i07/mcc_i07.sh +JIT/jit64/mcc/interop/mcc_i10/mcc_i10.sh +JIT/jit64/mcc/interop/mcc_i11/mcc_i11.sh +JIT/jit64/mcc/interop/mcc_i12/mcc_i12.sh +JIT/jit64/mcc/interop/mcc_i13/mcc_i13.sh JIT/jit64/mcc/interop/mcc_i14/mcc_i14.sh JIT/jit64/mcc/interop/mcc_i15/mcc_i15.sh JIT/jit64/mcc/interop/mcc_i16/mcc_i16.sh |