diff options
author | Pat Gavlin <pagavlin@microsoft.com> | 2016-01-04 16:58:07 -0800 |
---|---|---|
committer | Pat Gavlin <pagavlin@microsoft.com> | 2016-01-05 08:58:09 -0800 |
commit | 1e2cb743851c9eb3c87dc071f81e8aa125ca1a4b (patch) | |
tree | 3f65a4ad05d7951d94c25b49f34e8be4524c3777 /tests/src/JIT/Regression/VS-ia64-JIT/M00 | |
parent | 85f256e9b41cac20834d9695675e3ac8694454f9 (diff) | |
download | coreclr-1e2cb743851c9eb3c87dc071f81e8aa125ca1a4b.tar.gz coreclr-1e2cb743851c9eb3c87dc071f81e8aa125ca1a4b.tar.bz2 coreclr-1e2cb743851c9eb3c87dc071f81e8aa125ca1a4b.zip |
Port more JIT tests.
Most of these tests were blocked on unnecessary usage
of SerializableAttribute and Environment.ExitCode.
Diffstat (limited to 'tests/src/JIT/Regression/VS-ia64-JIT/M00')
6 files changed, 337 insertions, 0 deletions
diff --git a/tests/src/JIT/Regression/VS-ia64-JIT/M00/b111192/app.config b/tests/src/JIT/Regression/VS-ia64-JIT/M00/b111192/app.config new file mode 100644 index 0000000000..8077c95440 --- /dev/null +++ b/tests/src/JIT/Regression/VS-ia64-JIT/M00/b111192/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/VS-ia64-JIT/M00/b111192/b111192.csproj b/tests/src/JIT/Regression/VS-ia64-JIT/M00/b111192/b111192.csproj new file mode 100644 index 0000000000..ddadc3c710 --- /dev/null +++ b/tests/src/JIT/Regression/VS-ia64-JIT/M00/b111192/b111192.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> + <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>PdbOnly</DebugType> + </PropertyGroup> + <ItemGroup> + <Compile Include="strswitch2.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>
\ No newline at end of file diff --git a/tests/src/JIT/Regression/VS-ia64-JIT/M00/b111192/strswitch2.cs b/tests/src/JIT/Regression/VS-ia64-JIT/M00/b111192/strswitch2.cs new file mode 100644 index 0000000000..fc91797e61 --- /dev/null +++ b/tests/src/JIT/Regression/VS-ia64-JIT/M00/b111192/strswitch2.cs @@ -0,0 +1,53 @@ +// 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 strswitch +{ + internal class Class1 + { + [STAThread] + private static int Main(string[] args) + { + string[] s = { "one", "two", "three", "four", "five", "six" }; + for (int i = 0; i < s.Length; i++) + { + switch (s[i]) + { + case "one": + Console.WriteLine("s == one"); + break; + case "two": + Console.WriteLine("s == two"); + break; + case "three": + try + { + Console.WriteLine("s == three"); + } + catch (Exception e) + { + Console.WriteLine(e); + goto continueloop; // **** adding this will cause the asserts + } + break; + case "four": + Console.WriteLine("s == four"); + break; + case "five": + Console.WriteLine("s == five"); + break; + default: + Console.WriteLine("Greater than five"); + break; + }; + continue; + continueloop: + Console.WriteLine("Continuing"); + }; + finish: + return 100; + } + } +} diff --git a/tests/src/JIT/Regression/VS-ia64-JIT/M00/b113493/app.config b/tests/src/JIT/Regression/VS-ia64-JIT/M00/b113493/app.config new file mode 100644 index 0000000000..8077c95440 --- /dev/null +++ b/tests/src/JIT/Regression/VS-ia64-JIT/M00/b113493/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/VS-ia64-JIT/M00/b113493/b113493.csproj b/tests/src/JIT/Regression/VS-ia64-JIT/M00/b113493/b113493.csproj new file mode 100644 index 0000000000..fc955b5e5b --- /dev/null +++ b/tests/src/JIT/Regression/VS-ia64-JIT/M00/b113493/b113493.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> + <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>PdbOnly</DebugType> + </PropertyGroup> + <ItemGroup> + <Compile Include="bad.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/VS-ia64-JIT/M00/b113493/bad.cs b/tests/src/JIT/Regression/VS-ia64-JIT/M00/b113493/bad.cs new file mode 100644 index 0000000000..1e02a4c2c2 --- /dev/null +++ b/tests/src/JIT/Regression/VS-ia64-JIT/M00/b113493/bad.cs @@ -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. + +namespace DefaultNamespace +{ + + using System.Threading; + using System.Runtime.InteropServices; + using System; + using System.IO; + + internal class ExternalClass + { + internal ExternalException ee = new ExternalException(); + + public virtual void ThrowException() + { + throw ee; + } + } + + + public class ExternalException : Exception + { + static int ExitCode = 0; + + public static int Main(String[] args) + { + Thread mv_Thread; + ExternalException ee = new ExternalException(); + ExitCode = (100); + for (int i = 0; i < 2; i++) + { + mv_Thread = new Thread(new ThreadStart(ee.runtest)); + try + { + if (i == 0) + { + mv_Thread.Name = "" + i; + } + else + { + mv_Thread.Name = i + ""; + } + mv_Thread.Start(); + } + catch (Exception) + { + Console.Out.WriteLine("Exception was caught in main"); + } + } + return ExitCode; + } + + public virtual void runtest() + { + int counter = 0; + for (int j = 0; j < 10; j++) + { + try + { + if (Thread.CurrentThread.Name.Equals("0")) + { + Console.WriteLine("THREAD " + Thread.CurrentThread.Name + " COUNTER = " + j); + counter = j / (j - counter); + } + else + { + Console.WriteLine("Thread " + Thread.CurrentThread.Name + " counter = " + j); + counter = j / (j - j); + } + } + catch (Exception) + { + if (Thread.CurrentThread.Name.Equals("0")) + { + counter++; + } + else + { + counter += 2; + } + } + } + + if (Thread.CurrentThread.Name.Equals("0")) + { + if (counter == 10) + { + Console.Out.WriteLine("Test Passed (only if the lines aren't jumbled"); + } + else + { + Console.Out.WriteLine("TryCatch Test Failed, counter = " + counter); + ExitCode += (1); + } + } + else + { + if (counter == 20) + { + Console.Out.WriteLine("Test Passed (only if the lines aren't jumbled)"); + } + else + { + Console.Out.WriteLine("Test Failed, counter = " + counter); + ExitCode += (1); + } + } + } + + public virtual void recurse(int counter, int i) + { + char[] abc = new char[100]; + + if (counter == 100) + { + if (Thread.CurrentThread.Name.Equals("0")) + { + Console.WriteLine("THREAD " + Thread.CurrentThread.Name + " COUNTER = " + i + " : THROWING EXTERNAL EX"); + } + else + { + Console.WriteLine("Thread " + Thread.CurrentThread.Name + " counter = " + i + " : Throwing external ex "); + } + (new ExternalClass()).ThrowException(); + } + else + recurse(++counter, i); + } + } +} |