diff options
author | Alexander Soldatov <soldatov.a@samsung.com> | 2017-03-14 16:34:39 +0300 |
---|---|---|
committer | Alexander Soldatov <soldatov.a@samsung.com> | 2017-03-15 12:49:11 +0300 |
commit | f734e77607bdf9b39049216948fc6ce243c69852 (patch) | |
tree | c2cad6e4ceaad745d348aa27db6d25c823725217 /tests | |
parent | c52a9f7a3019d408cd03aef9e5fb33263cb047ba (diff) | |
download | coreclr-f734e77607bdf9b39049216948fc6ce243c69852.tar.gz coreclr-f734e77607bdf9b39049216948fc6ce243c69852.tar.bz2 coreclr-f734e77607bdf9b39049216948fc6ce243c69852.zip |
Added Array tests to CodeGenBringUpTests
Diffstat (limited to 'tests')
19 files changed, 608 insertions, 0 deletions
diff --git a/tests/src/AllTestProjects.sln b/tests/src/AllTestProjects.sln index 4711e81b3a..be437ec986 100644 --- a/tests/src/AllTestProjects.sln +++ b/tests/src/AllTestProjects.sln @@ -623,6 +623,24 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Args4", "JIT\CodeGenBringUp EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Args5", "JIT\CodeGenBringUpTests\Args5.csproj", "{30993D25-1F0D-4CF4-98C0-5F6470B87382}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Array1", "JIT\CodeGenBringUpTests\Array1.csproj", "{7E3680E3-36FC-4B6B-841A-80B8D0C4394C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Array2", "JIT\CodeGenBringUpTests\Array2.csproj", "{4689170F-4BC1-4592-9753-CD4209D950D7}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Array3", "JIT\CodeGenBringUpTests\Array3.csproj", "{B4FE2E03-298E-41B8-A32C-8FD0F1BF7E8C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Array4", "JIT\CodeGenBringUpTests\Array4.csproj", "{11F01248-05A0-4FA0-9345-75273E7276C9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ArrayExc", "JIT\CodeGenBringUpTests\ArrayExc.csproj", "{DBC775DF-5D8A-42A5-87A5-CC51AAAABE3C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ArrayJagged", "JIT\CodeGenBringUpTests\ArrayJagged.csproj", "{0E6C1DC4-EFF7-45CC-8A27-37BA07AC30EE}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ArrayMD1", "JIT\CodeGenBringUpTests\ArrayMD1.csproj", "{30A8AD2E-3B3B-4813-88E1-9EF2E75BB685}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ArrayMD2", "JIT\CodeGenBringUpTests\ArrayMD2.csproj", "{C46B2CCD-C66B-40C8-A031-67FED61AFEDB}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ArrayObj", "JIT\CodeGenBringUpTests\ArrayObj.csproj", "{AA342BCA-74DE-41AC-88E9-5608E2DCFFAB}" +EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AsgAdd1", "JIT\CodeGenBringUpTests\AsgAdd1.csproj", "{2DBCC16D-CB12-43D1-A4B8-9E82BE1DB891}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AsgAnd1", "JIT\CodeGenBringUpTests\AsgAnd1.csproj", "{18FD8738-0685-482B-9D97-CEB598AAAC5A}" diff --git a/tests/src/JIT/CodeGenBringUpTests/Array1.cs b/tests/src/JIT/CodeGenBringUpTests/Array1.cs new file mode 100644 index 0000000000..0281615186 --- /dev/null +++ b/tests/src/JIT/CodeGenBringUpTests/Array1.cs @@ -0,0 +1,28 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. +// + +using System; +using System.Runtime.CompilerServices; + +public class BringUpTest +{ + const int Pass = 100; + const int Fail = -1; + + [MethodImplAttribute(MethodImplOptions.NoInlining)] + static void Array1(int[] a) + { + a[1] = 5; + } + + static int Main() + { + int[] a = {1, 2, 3, 4}; + Array1(a); + + if (a[1] != 5) return Fail; + return Pass; + } +}
\ No newline at end of file diff --git a/tests/src/JIT/CodeGenBringUpTests/Array1.csproj b/tests/src/JIT/CodeGenBringUpTests/Array1.csproj new file mode 100644 index 0000000000..c2c05923e1 --- /dev/null +++ b/tests/src/JIT/CodeGenBringUpTests/Array1.csproj @@ -0,0 +1,37 @@ +<?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> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{7E3680E3-36FC-4B6B-841A-80B8D0C4394C}</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> + <IlasmRoundTrip>true</IlasmRoundTrip> + </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> + <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Array1.cs" /> + </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/CodeGenBringUpTests/Array2.cs b/tests/src/JIT/CodeGenBringUpTests/Array2.cs new file mode 100644 index 0000000000..e73b2712db --- /dev/null +++ b/tests/src/JIT/CodeGenBringUpTests/Array2.cs @@ -0,0 +1,26 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. +// + +using System; +using System.Runtime.CompilerServices; + +public class BringUpTest +{ + const int Pass = 100; + const int Fail = -1; + + [MethodImplAttribute(MethodImplOptions.NoInlining)] + static int Array2(int[] a) + { + return a[1]; + } + + static int Main() + { + int[] a = {1, 2, 3, 4}; + if (Array2(a) != 2) return Fail; + return Pass; + } +}
\ No newline at end of file diff --git a/tests/src/JIT/CodeGenBringUpTests/Array2.csproj b/tests/src/JIT/CodeGenBringUpTests/Array2.csproj new file mode 100644 index 0000000000..b55ba38a56 --- /dev/null +++ b/tests/src/JIT/CodeGenBringUpTests/Array2.csproj @@ -0,0 +1,37 @@ +<?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> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{4689170F-4BC1-4592-9753-CD4209D950D7}</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> + <IlasmRoundTrip>true</IlasmRoundTrip> + </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> + <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Array2.cs" /> + </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/CodeGenBringUpTests/Array3.cs b/tests/src/JIT/CodeGenBringUpTests/Array3.cs new file mode 100644 index 0000000000..a6bab21d57 --- /dev/null +++ b/tests/src/JIT/CodeGenBringUpTests/Array3.cs @@ -0,0 +1,27 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. +// + +using System; +using System.Runtime.CompilerServices; + +public class BringUpTest +{ + const int Pass = 100; + const int Fail = -1; + + [MethodImplAttribute(MethodImplOptions.NoInlining)] + static int Array3() + { + int[] a = {1, 2, 3, 4}; + a[1] = 5; + return a[1]; + } + + static int Main() + { + if (Array3() != 5) return Fail; + return Pass; + } +}
\ No newline at end of file diff --git a/tests/src/JIT/CodeGenBringUpTests/Array3.csproj b/tests/src/JIT/CodeGenBringUpTests/Array3.csproj new file mode 100644 index 0000000000..3e3f3bd238 --- /dev/null +++ b/tests/src/JIT/CodeGenBringUpTests/Array3.csproj @@ -0,0 +1,37 @@ +<?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> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{B4FE2E03-298E-41B8-A32C-8FD0F1BF7E8C}</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> + <IlasmRoundTrip>true</IlasmRoundTrip> + </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> + <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Array3.cs" /> + </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/CodeGenBringUpTests/Array4.cs b/tests/src/JIT/CodeGenBringUpTests/Array4.cs new file mode 100644 index 0000000000..938ab97ae2 --- /dev/null +++ b/tests/src/JIT/CodeGenBringUpTests/Array4.cs @@ -0,0 +1,25 @@ + // Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. +// + +using System; +using System.Runtime.CompilerServices; + +public class BringUpTest +{ + const int Pass = 100; + const int Fail = -1; + + [MethodImplAttribute(MethodImplOptions.NoInlining)] + static int Array4(int i) { + int[] a = {1, 2, 3, 4}; + return a[i]; + } + + static int Main() + { + if (Array4(1) != 2) return Fail; + return Pass; + } +}
\ No newline at end of file diff --git a/tests/src/JIT/CodeGenBringUpTests/Array4.csproj b/tests/src/JIT/CodeGenBringUpTests/Array4.csproj new file mode 100644 index 0000000000..b09f15f176 --- /dev/null +++ b/tests/src/JIT/CodeGenBringUpTests/Array4.csproj @@ -0,0 +1,37 @@ +<?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> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{11F01248-05A0-4FA0-9345-75273E7276C9}</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> + <IlasmRoundTrip>true</IlasmRoundTrip> + </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> + <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Array4.cs" /> + </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/CodeGenBringUpTests/ArrayExc.cs b/tests/src/JIT/CodeGenBringUpTests/ArrayExc.cs new file mode 100644 index 0000000000..7822467113 --- /dev/null +++ b/tests/src/JIT/CodeGenBringUpTests/ArrayExc.cs @@ -0,0 +1,34 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. +// + +using System; +using System.Runtime.CompilerServices; + +public class BringUpTest +{ + const int Pass = 100; + const int Fail = -1; + + [MethodImplAttribute(MethodImplOptions.NoInlining)] + static int ArrayExc() + { + int[] a = {1, 2, 3, 4}; + return a[5]; + } + + static int Main() + { + try + { + ArrayExc(); + return Fail; + } + catch (System.IndexOutOfRangeException) + { + // OK + } + return Pass; + } +}
\ No newline at end of file diff --git a/tests/src/JIT/CodeGenBringUpTests/ArrayExc.csproj b/tests/src/JIT/CodeGenBringUpTests/ArrayExc.csproj new file mode 100644 index 0000000000..4ab19af00b --- /dev/null +++ b/tests/src/JIT/CodeGenBringUpTests/ArrayExc.csproj @@ -0,0 +1,37 @@ +<?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> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{DBC775DF-5D8A-42A5-87A5-CC51AAAABE3C}</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> + <IlasmRoundTrip>true</IlasmRoundTrip> + </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> + <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" /> + </ItemGroup> + <ItemGroup> + <Compile Include="ArrayExc.cs" /> + </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/CodeGenBringUpTests/ArrayJagged.cs b/tests/src/JIT/CodeGenBringUpTests/ArrayJagged.cs new file mode 100644 index 0000000000..1f0ec014aa --- /dev/null +++ b/tests/src/JIT/CodeGenBringUpTests/ArrayJagged.cs @@ -0,0 +1,28 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. +// + +using System; +using System.Runtime.CompilerServices; + +public class BringUpTest +{ + const int Pass = 100; + const int Fail = -1; + + [MethodImplAttribute(MethodImplOptions.NoInlining)] + static int ArrayJagged(int i) + { + int[][] a = new int[2][]; + a[0] = new int[2] {0, 1}; + a[1] = new int[2] {2, 3}; + return a[1][i]; + } + + static int Main() + { + if (ArrayJagged(1) != 3) return Fail; + return Pass; + } +}
\ No newline at end of file diff --git a/tests/src/JIT/CodeGenBringUpTests/ArrayJagged.csproj b/tests/src/JIT/CodeGenBringUpTests/ArrayJagged.csproj new file mode 100644 index 0000000000..bd20e7bddd --- /dev/null +++ b/tests/src/JIT/CodeGenBringUpTests/ArrayJagged.csproj @@ -0,0 +1,37 @@ +<?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> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{0E6C1DC4-EFF7-45CC-8A27-37BA07AC30EE}</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> + <IlasmRoundTrip>true</IlasmRoundTrip> + </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> + <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" /> + </ItemGroup> + <ItemGroup> + <Compile Include="ArrayJagged.cs" /> + </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/CodeGenBringUpTests/ArrayMD1.cs b/tests/src/JIT/CodeGenBringUpTests/ArrayMD1.cs new file mode 100644 index 0000000000..642cd98ca6 --- /dev/null +++ b/tests/src/JIT/CodeGenBringUpTests/ArrayMD1.cs @@ -0,0 +1,26 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. +// + +using System; +using System.Runtime.CompilerServices; + +public class BringUpTest +{ + const int Pass = 100; + const int Fail = -1; + + [MethodImplAttribute(MethodImplOptions.NoInlining)] + static int ArrayMD1() + { + int[,] a = {{1, 2}, {3, 4}}; + return a[0, 1]; + } + + static int Main() + { + if (ArrayMD1() != 2) return Fail; + return Pass; + } +}
\ No newline at end of file diff --git a/tests/src/JIT/CodeGenBringUpTests/ArrayMD1.csproj b/tests/src/JIT/CodeGenBringUpTests/ArrayMD1.csproj new file mode 100644 index 0000000000..23d03433ce --- /dev/null +++ b/tests/src/JIT/CodeGenBringUpTests/ArrayMD1.csproj @@ -0,0 +1,37 @@ +<?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> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{30A8AD2E-3B3B-4813-88E1-9EF2E75BB685}</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> + <IlasmRoundTrip>true</IlasmRoundTrip> + </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> + <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" /> + </ItemGroup> + <ItemGroup> + <Compile Include="ArrayMD1.cs" /> + </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/CodeGenBringUpTests/ArrayMD2.cs b/tests/src/JIT/CodeGenBringUpTests/ArrayMD2.cs new file mode 100644 index 0000000000..dba9dcc3d4 --- /dev/null +++ b/tests/src/JIT/CodeGenBringUpTests/ArrayMD2.cs @@ -0,0 +1,27 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. +// + +using System; +using System.Runtime.CompilerServices; + +public class BringUpTest +{ + const int Pass = 100; + const int Fail = -1; + + [MethodImplAttribute(MethodImplOptions.NoInlining)] + static int ArrayMD2(int x, int y) + { + int[,] a = new int[2, 3]; + a[x, y] = 42; + return a[x, y]; + } + + static int Main() + { + if (ArrayMD2(1, 1) != 42) return Fail; + return Pass; + } +}
\ No newline at end of file diff --git a/tests/src/JIT/CodeGenBringUpTests/ArrayMD2.csproj b/tests/src/JIT/CodeGenBringUpTests/ArrayMD2.csproj new file mode 100644 index 0000000000..fcdd61f129 --- /dev/null +++ b/tests/src/JIT/CodeGenBringUpTests/ArrayMD2.csproj @@ -0,0 +1,37 @@ +<?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> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{C46B2CCD-C66B-40C8-A031-67FED61AFEDB}</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> + <IlasmRoundTrip>true</IlasmRoundTrip> + </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> + <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" /> + </ItemGroup> + <ItemGroup> + <Compile Include="ArrayMD2.cs" /> + </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/CodeGenBringUpTests/ArrayObj.cs b/tests/src/JIT/CodeGenBringUpTests/ArrayObj.cs new file mode 100644 index 0000000000..75426b6fc6 --- /dev/null +++ b/tests/src/JIT/CodeGenBringUpTests/ArrayObj.cs @@ -0,0 +1,36 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. +// + +using System; +using System.Runtime.CompilerServices; + +public class BringUpTest +{ + const int Pass = 100; + const int Fail = -1; + + class Dummy + { + public int field; + public Dummy(int f) + { + field = f; + } + } + + [MethodImplAttribute(MethodImplOptions.NoInlining)] + static int ArrayObj(int i) + { + Dummy[] a = {new Dummy(0), new Dummy(1), new Dummy(2), new Dummy(3), new Dummy(4), + new Dummy(5), new Dummy(6), new Dummy(7), new Dummy(8), new Dummy(9)}; + return a[i].field; + } + + static int Main() + { + if (ArrayObj(1) != 1) return Fail; + return Pass; + } +}
\ No newline at end of file diff --git a/tests/src/JIT/CodeGenBringUpTests/ArrayObj.csproj b/tests/src/JIT/CodeGenBringUpTests/ArrayObj.csproj new file mode 100644 index 0000000000..0d73a2b9eb --- /dev/null +++ b/tests/src/JIT/CodeGenBringUpTests/ArrayObj.csproj @@ -0,0 +1,37 @@ +<?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> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{AA342BCA-74DE-41AC-88E9-5608E2DCFFAB}</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> + <IlasmRoundTrip>true</IlasmRoundTrip> + </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> + <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" /> + </ItemGroup> + <ItemGroup> + <Compile Include="ArrayObj.cs" /> + </ItemGroup> + <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" /> + <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "> + </PropertyGroup> +</Project>
\ No newline at end of file |