diff options
author | Richard L Ford <richford@microsoft.com> | 2015-12-03 00:23:02 -0800 |
---|---|---|
committer | Richard L Ford <richford@microsoft.com> | 2015-12-07 20:50:02 -0800 |
commit | 99570b16c3a852abc18706c336103c5352f41ba2 (patch) | |
tree | 42c28d2fc2c53d65c5ec59aee97553f67c8f9c07 /tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M02 | |
parent | 01fdf5036c24468185e7b6f01976100424183be2 (diff) | |
download | coreclr-99570b16c3a852abc18706c336103c5352f41ba2.tar.gz coreclr-99570b16c3a852abc18706c336103c5352f41ba2.tar.bz2 coreclr-99570b16c3a852abc18706c336103c5352f41ba2.zip |
Port more C# unit tests
The project files were generated automatically from a database
and the source files scrubbed and formatted.
In addition, some added tests are still failing. Issues were
created for these and exclusions added, for windows and for
non-windows.
Diffstat (limited to 'tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M02')
12 files changed, 565 insertions, 0 deletions
diff --git a/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M02/b00719/app.config b/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M02/b00719/app.config new file mode 100644 index 0000000000..6f7bbd9d2b --- /dev/null +++ b/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M02/b00719/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> diff --git a/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M02/b00719/b00719.cs b/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M02/b00719/b00719.cs new file mode 100644 index 0000000000..e72e79a083 --- /dev/null +++ b/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M02/b00719/b00719.cs @@ -0,0 +1,22 @@ +// 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() + { + try { f(); return 1; } + catch (OverflowException) { Console.WriteLine("PASSED"); return 100; } + return 2; + } + + public static void f() + { + int i = 4; + i = i - 10; + int[] a = new int[i]; + } +} + diff --git a/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M02/b00719/b00719.csproj b/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M02/b00719/b00719.csproj new file mode 100644 index 0000000000..957bafc2df --- /dev/null +++ b/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M02/b00719/b00719.csproj @@ -0,0 +1,54 @@ +<?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 .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> + <!-- Set to 'Full' if the Debug? column is marked in the spreadsheet. Leave blank otherwise. --> + <DebugType></DebugType> + <NoLogo>True</NoLogo> + <NoStandardLib>True</NoStandardLib> + <Noconfig>True</Noconfig> + <DefineConstants>$(DefineConstants);CORECLR</DefineConstants> + </PropertyGroup> + <ItemGroup> + <Compile Include="b00719.cs" /> + </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> + <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.2-M02/b20785/app.config b/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M02/b20785/app.config new file mode 100644 index 0000000000..6f7bbd9d2b --- /dev/null +++ b/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M02/b20785/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> diff --git a/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M02/b20785/b20785.csproj b/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M02/b20785/b20785.csproj new file mode 100644 index 0000000000..558ca8687a --- /dev/null +++ b/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M02/b20785/b20785.csproj @@ -0,0 +1,54 @@ +<?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 .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> + <!-- Set to 'Full' if the Debug? column is marked in the spreadsheet. Leave blank otherwise. --> + <DebugType></DebugType> + <NoLogo>True</NoLogo> + <NoStandardLib>True</NoStandardLib> + <Noconfig>True</Noconfig> + <DefineConstants>$(DefineConstants);DESKTOP</DefineConstants> + </PropertyGroup> + <ItemGroup> + <Compile Include="trep.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/Regression/CLR-x86-JIT/V1.2-M02/b20785/trep.cs b/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M02/b20785/trep.cs new file mode 100644 index 0000000000..07169857d3 --- /dev/null +++ b/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M02/b20785/trep.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System; +using System.Threading; + +internal struct Gen +{ + public void Target<U>() + { + } + public static void DelegateTest<U>() + { + ThreadStart d = new ThreadStart(new Gen().Target<U>); + IAsyncResult ar = d.BeginInvoke(null, null); + WaitHandle.WaitAll(new System.Threading.WaitHandle[] { ar.AsyncWaitHandle }); + } +} + +public class Test +{ + public static int Main() + { + Gen.DelegateTest<object>(); + return 100; + } +} + + diff --git a/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M02/b21296/app.config b/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M02/b21296/app.config new file mode 100644 index 0000000000..6f7bbd9d2b --- /dev/null +++ b/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M02/b21296/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> diff --git a/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M02/b21296/b21296.csproj b/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M02/b21296/b21296.csproj new file mode 100644 index 0000000000..22d0911c22 --- /dev/null +++ b/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M02/b21296/b21296.csproj @@ -0,0 +1,55 @@ +<?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 .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> + <!-- Set to 'Full' if the Debug? column is marked in the spreadsheet. Leave blank otherwise. --> + <DebugType></DebugType> + <NoLogo>True</NoLogo> + <NoStandardLib>True</NoStandardLib> + <Noconfig>True</Noconfig> + <AllowUnsafeBlocks>True</AllowUnsafeBlocks> + <DefineConstants>$(DefineConstants);CORECLR</DefineConstants> + </PropertyGroup> + <ItemGroup> + <Compile Include="ptr.cs" /> + </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> + <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.2-M02/b21296/ptr.cs b/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M02/b21296/ptr.cs new file mode 100644 index 0000000000..94d7a71683 --- /dev/null +++ b/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M02/b21296/ptr.cs @@ -0,0 +1,161 @@ +// 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 CTest +{ + private static volatile int s_sx = 0; + + private static unsafe void wstrcpy(char* dmem, char* smem, int charCount) + { + if (charCount > 0) + { + if ((((int)dmem ^ (int)smem) & 3) == 0) + { + while (((int)dmem & 3) != 0 && charCount > 0) + { + dmem[0] = smem[0]; + dmem += 1; + smem += 1; + charCount -= 1; + } + if (charCount >= 8) + { + charCount -= 8; + do + { + ((uint*)dmem)[0] = ((uint*)smem)[0]; + ((uint*)dmem)[1] = ((uint*)smem)[1]; + ((uint*)dmem)[2] = ((uint*)smem)[2]; + ((uint*)dmem)[3] = ((uint*)smem)[3]; + dmem += 8; + smem += 8; + charCount -= 8; + } while (charCount >= 0); + } + if ((charCount & 4) != 0) + { + ((uint*)dmem)[0] = ((uint*)smem)[0]; + ((uint*)dmem)[1] = ((uint*)smem)[1]; + dmem += 4; + smem += 4; + } + if ((charCount & 2) != 0) + { + ((uint*)dmem)[0] = ((uint*)smem)[0]; + dmem += 2; + smem += 2; + } + } + else + { + if (charCount >= 8) + { + charCount -= 8; + do + { + dmem[0] = smem[0]; + dmem[1] = smem[1]; + dmem[2] = smem[2]; + dmem[3] = smem[3]; + dmem[4] = smem[4]; + dmem[5] = smem[5]; + dmem[6] = smem[6]; + dmem[7] = smem[7]; + dmem += 8; + smem += 8; + charCount -= 8; + } + while (charCount >= 0); + } + if ((charCount & 4) != 0) + { + dmem[0] = smem[0]; + dmem[1] = smem[1]; + dmem[2] = smem[2]; + dmem[3] = smem[3]; + dmem += 4; + smem += 4; + } + if ((charCount & 2) != 0) + { + dmem[0] = smem[0]; + dmem[1] = smem[1]; + dmem += 2; + smem += 2; + } + } + + if ((charCount & 1) != 0) + { + dmem[0] = smem[0]; + } + } + } + + public static unsafe String CtorCharPtr(IntPtr p) + { + char* ptr = (char*)p; + if (ptr >= (char*)64000) + { + try + { + char* end = ptr; + + + while (((uint)end & 3) != 0 && *end != 0) + end++; + if (*end != 0) + { + while ((end[0] & end[1]) != 0 || (end[0] != 0 && end[1] != 0)) + { + end += 2; + } + } + for (; *end != 0; end++) + ; + + int count = (int)(end - ptr); + String result = "abcdef"; + fixed (char* dest = result) + wstrcpy(dest, ptr, count); + + for (int j = 0; j < 2000; j++) + { + if ((j & 5) != 0) + s_sx++; + else if ((j & 10) == 8) + s_sx--; + + s_sx = (s_sx + j) / 541; + } + + return result; + } + catch (NullReferenceException) + { + throw new Exception(); + } + } + else if (ptr == null) + return ""; + else + throw new Exception(); + } + + private static unsafe String Test() + { + String s = "Hello!"; + fixed (char* p = s) + { + return CtorCharPtr((IntPtr)p); + } + } + + public static int Main() + { + System.Console.WriteLine(Test()); + return 100; + } +} diff --git a/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M02/b31398/app.config b/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M02/b31398/app.config new file mode 100644 index 0000000000..6f7bbd9d2b --- /dev/null +++ b/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M02/b31398/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> diff --git a/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M02/b31398/b31398.csproj b/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M02/b31398/b31398.csproj new file mode 100644 index 0000000000..85402afbe4 --- /dev/null +++ b/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M02/b31398/b31398.csproj @@ -0,0 +1,54 @@ +<?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 .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> + <!-- Set to 'Full' if the Debug? column is marked in the spreadsheet. Leave blank otherwise. --> + <DebugType></DebugType> + <NoLogo>True</NoLogo> + <NoStandardLib>True</NoStandardLib> + <Noconfig>True</Noconfig> + <DefineConstants>$(DefineConstants);CORECLR</DefineConstants> + </PropertyGroup> + <ItemGroup> + <Compile Include="cs1.cs" /> + </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> + <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.2-M02/b31398/cs1.cs b/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M02/b31398/cs1.cs new file mode 100644 index 0000000000..a29f9db736 --- /dev/null +++ b/tests/src/JIT/Regression/CLR-x86-JIT/V1.2-M02/b31398/cs1.cs @@ -0,0 +1,28 @@ +// 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.Reflection; +using System.Runtime.InteropServices; + +internal delegate int Deleg(int i, int j, int k, int l, int m, int n); + +public class cs1 +{ + public static int foo(int i, int j, int k, int l, int m, int n) + { + return i * 100; + } + + public const System.Runtime.CompilerServices.MethodImplOptions s_enum2 = System.Runtime.CompilerServices.MethodImplOptions.NoInlining; + + [System.Runtime.CompilerServices.MethodImpl( + System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] + public static int Main(String[] args) + { + cs1 t = new cs1(); + + Console.WriteLine(t.GetType() == typeof(cs1) ? 100 : args.Length); + return 100; + } +} |