summaryrefslogtreecommitdiff
path: root/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b80764
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b80764')
-rw-r--r--tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b80764/app.config27
-rw-r--r--tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b80764/b80764.cs83
-rw-r--r--tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b80764/b80764.csproj55
3 files changed, 165 insertions, 0 deletions
diff --git a/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b80764/app.config b/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b80764/app.config
new file mode 100644
index 0000000000..6f7bbd9d2b
--- /dev/null
+++ b/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b80764/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-M12-Beta2/b80764/b80764.cs b/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b80764/b80764.cs
new file mode 100644
index 0000000000..08a84aabdb
--- /dev/null
+++ b/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b80764/b80764.cs
@@ -0,0 +1,83 @@
+
+
+using System;
+using System.Runtime.InteropServices;
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+namespace JitTest
+{
+ internal class Test
+ {
+ private static unsafe void initbuf(byte* buf, int num)
+ {
+ for (int i = 0; i < 100; i++)
+ buf[i] = (byte)i;
+ Console.WriteLine("buffer " + num.ToString() + " allocated");
+ }
+
+ private static unsafe void ckbuf(byte* buf, int num)
+ {
+ if (buf != null)
+ {
+ for (int i = 0; i < 100; i++)
+ {
+ if (buf[i] != (byte)i)
+ {
+ Console.WriteLine("buffer " + num.ToString() + " is garbage !!");
+ return;
+ }
+ }
+ }
+ Console.WriteLine("buffer " + num.ToString() + " is OK");
+ }
+
+ private static unsafe int Main()
+ {
+ byte* buf1 = stackalloc byte[100], buf2 = null, buf3 = null;
+ initbuf(buf1, 1);
+ ckbuf(buf1, 1);
+ try
+ {
+ Console.WriteLine("--- entered outer try ---");
+ byte* TEMP1 = stackalloc byte[100];
+ buf2 = TEMP1;
+ initbuf(buf2, 2);
+ ckbuf(buf1, 1);
+ ckbuf(buf2, 2);
+ try
+ {
+ Console.WriteLine("--- entered inner try ---");
+ byte* TEMP2 = stackalloc byte[100];
+ buf3 = TEMP2;
+ initbuf(buf3, 3);
+ ckbuf(buf1, 1);
+ ckbuf(buf2, 2);
+ ckbuf(buf3, 3);
+ Console.WriteLine("--- throwing exception ---");
+ throw new Exception();
+ }
+ finally
+ {
+ Console.WriteLine("--- finally ---");
+ ckbuf(buf1, 1);
+ ckbuf(buf2, 2);
+ ckbuf(buf3, 3);
+ }
+ }
+ catch (Exception)
+ {
+ Console.WriteLine("--- catch ---");
+ ckbuf(buf1, 1);
+ ckbuf(buf2, 2);
+ ckbuf(buf3, 3);
+ }
+ Console.WriteLine("--- after try-catch ---");
+ ckbuf(buf1, 1);
+ ckbuf(buf2, 2);
+ ckbuf(buf3, 3);
+ Console.WriteLine("=== TEST ENDED ===");
+ return 100;
+ }
+ }
+}
diff --git a/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b80764/b80764.csproj b/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b80764/b80764.csproj
new file mode 100644
index 0000000000..6f83ec9385
--- /dev/null
+++ b/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b80764/b80764.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="b80764.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>