summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/arm64/corefx_test_exclusions.txt1
-rw-r--r--tests/issues.targets3
-rw-r--r--tests/scripts/run-corefx-tests.bat2
-rwxr-xr-xtests/scripts/run-corefx-tests.sh4
-rw-r--r--tests/src/JIT/Directed/arglist/vararg.cs10
-rw-r--r--tests/src/JIT/Methodical/largeframes/skip3/skippage3.cs2
-rw-r--r--tests/src/JIT/Regression/JitBlue/GitHub_20958/GitHub_20958.cs61
-rw-r--r--tests/src/JIT/Regression/JitBlue/GitHub_23411/GitHub_23411.il4
-rw-r--r--tests/src/JIT/Regression/JitBlue/GitHub_23792/GitHub_23792.il163
-rw-r--r--tests/src/JIT/Regression/JitBlue/GitHub_23792/GitHub_23792.ilproj37
-rw-r--r--tests/src/JIT/Regression/JitBlue/GitHub_23950/GitHub_23950.il49
-rw-r--r--tests/src/JIT/Regression/JitBlue/GitHub_23950/GitHub_23950.ilproj (renamed from tests/src/JIT/Regression/JitBlue/GitHub_20958/GitHub_20958.csproj)18
12 files changed, 270 insertions, 84 deletions
diff --git a/tests/arm64/corefx_test_exclusions.txt b/tests/arm64/corefx_test_exclusions.txt
index 60a678b965..6078887b91 100644
--- a/tests/arm64/corefx_test_exclusions.txt
+++ b/tests/arm64/corefx_test_exclusions.txt
@@ -1,5 +1,4 @@
Microsoft.Win32.SystemEvents.Tests # https://github.com/dotnet/coreclr/issues/22442 -- timeout
-System.ComponentModel.Composition.Tests # https://github.com/dotnet/coreclr/issues/18913
System.Drawing.Common.Tests # https://github.com/dotnet/corefx/issues/35424
System.IO.FileSystem.Tests # https://github.com/dotnet/coreclr/issues/23447
System.IO.Tests.dll # https://github.com/dotnet/coreclr/pull/23388 - reenable with the new CoreFX test runner
diff --git a/tests/issues.targets b/tests/issues.targets
index a819fb7564..0a1103ddfc 100644
--- a/tests/issues.targets
+++ b/tests/issues.targets
@@ -414,9 +414,6 @@
<ExcludeList Include="$(XunitTestBinBase)/baseservices/varargs/varargsupport/*">
<Issue>Varargs supported on this platform</Issue>
</ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)/JIT/Directed/arglist/vararg/*">
- <Issue>Needs triage</Issue>
- </ExcludeList>
<ExcludeList Include="$(XunitTestBinBase)/tracing/runtimeeventsource/runtimeeventsource/*">
<Issue>Needs Triage</Issue>
</ExcludeList>
diff --git a/tests/scripts/run-corefx-tests.bat b/tests/scripts/run-corefx-tests.bat
index b77644f44e..34f86d2949 100644
--- a/tests/scripts/run-corefx-tests.bat
+++ b/tests/scripts/run-corefx-tests.bat
@@ -81,7 +81,7 @@ if %errorlevel% EQU 0 (
echo COREFX TEST %_t3% EXCLUDED
set /A _skipped=_skipped + 1
) else (
- call :run %1\RunTests.cmd %_runtime_path%
+ call :run %1\RunTests.cmd --runtime-path %_runtime_path%
)
goto :eof
diff --git a/tests/scripts/run-corefx-tests.sh b/tests/scripts/run-corefx-tests.sh
index 2d1dcb8604..4a04f0a7b3 100755
--- a/tests/scripts/run-corefx-tests.sh
+++ b/tests/scripts/run-corefx-tests.sh
@@ -327,9 +327,9 @@ run_test()
echo
echo "Running tests in $dirName"
- echo "${TimeoutTool}./RunTests.sh $Runtime"
+ echo "${TimeoutTool}./RunTests.sh --runtime-path $Runtime"
echo
- ${TimeoutTool}./RunTests.sh "$Runtime"
+ ${TimeoutTool}./RunTests.sh --runtime-path "$Runtime"
exitCode=$?
if [ $exitCode -ne 0 ] ; then
diff --git a/tests/src/JIT/Directed/arglist/vararg.cs b/tests/src/JIT/Directed/arglist/vararg.cs
index cf05aeb123..cc2ccc4727 100644
--- a/tests/src/JIT/Directed/arglist/vararg.cs
+++ b/tests/src/JIT/Directed/arglist/vararg.cs
@@ -4044,8 +4044,6 @@ namespace NativeVarargTest
[MethodImpl(MethodImplOptions.NoInlining)]
static bool TestEchoThreeDoubleStructManagedNoVararg()
{
-#if false
- // Disabled - see issue #20046
ThreeDoubleStruct arg = new ThreeDoubleStruct();
arg.a = 1.0;
arg.b = 2.0;
@@ -4055,9 +4053,6 @@ namespace NativeVarargTest
bool equal = arg.a == returnValue.a && arg.b == returnValue.b && arg.c == returnValue.c;
return equal;
-#else
- return true;
-#endif
}
[MethodImpl(MethodImplOptions.NoInlining)]
@@ -4081,8 +4076,6 @@ namespace NativeVarargTest
[MethodImpl(MethodImplOptions.NoInlining)]
static bool TestEchoFourDoubleStructManagedNoVararg()
{
-#if false
- // Disabled - see issue #20046
FourDoubleStruct arg = new FourDoubleStruct();
arg.a = 1.0;
arg.b = 2.0;
@@ -4096,9 +4089,6 @@ namespace NativeVarargTest
arg.d == returnValue.d;
return equal;
-#else
- return true;
-#endif
}
[MethodImpl(MethodImplOptions.NoInlining)]
diff --git a/tests/src/JIT/Methodical/largeframes/skip3/skippage3.cs b/tests/src/JIT/Methodical/largeframes/skip3/skippage3.cs
index 0b3b745126..f4ec9ff693 100644
--- a/tests/src/JIT/Methodical/largeframes/skip3/skippage3.cs
+++ b/tests/src/JIT/Methodical/largeframes/skip3/skippage3.cs
@@ -58,7 +58,7 @@ namespace BigFrames
s.i2 = level;
Escape(ref s);
- if (level < 20)
+ if (level < 10)
{
EatStackThenTest1(level + 1);
}
diff --git a/tests/src/JIT/Regression/JitBlue/GitHub_20958/GitHub_20958.cs b/tests/src/JIT/Regression/JitBlue/GitHub_20958/GitHub_20958.cs
deleted file mode 100644
index 45730f5ee4..0000000000
--- a/tests/src/JIT/Regression/JitBlue/GitHub_20958/GitHub_20958.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-// 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;
-
-// This test was extracted from the Indexer tests in the corefx System.Memory.Tests.
-// The JIT was trying to expand the form of indexer that takes a range, but was not
-// correctly expanding it, as it was expecting only the scalar index form.
-
-public class GitHub_20958
-{
-
- public static int IndexerWithRangeTest()
- {
- int returnVal = 100;
-
- ReadOnlySpan<char> span = "Hello".AsSpan();
- ReadOnlySpan<char> sliced = span[new Range(new Index(1, fromEnd: false), new Index(1, fromEnd: true))];
- if (span.Slice(1, 3) != sliced)
- {
- returnVal = -1;
- }
- try
- {
- ReadOnlySpan<char> s = "Hello".AsSpan()[new Range(new Index(1, fromEnd: true), new Index(1, fromEnd: false))];
- returnVal = -1;
- }
- catch (ArgumentOutOfRangeException)
- {
- }
- catch (Exception e)
- {
- returnVal = -1;
- }
- Span<char> span1 = new Span<char>(new char[] { 'H', 'e', 'l', 'l', 'o' });
- Span<char> sliced1 = span1[new Range(new Index(2, fromEnd: false), new Index(1, fromEnd: true))];
- if (span1.Slice(2, 2) != sliced1)
- {
- returnVal = -1;
- }
- try
- {
- Span<char> s = new Span<char>(new char[] { 'H', 'i' })[new Range(new Index(0, fromEnd: true), new Index(1, fromEnd: false))];
- returnVal = -1;
- }
- catch (ArgumentOutOfRangeException)
- {
- }
- catch (Exception e)
- {
- returnVal = -1;
- }
- return returnVal;
- }
-
- public static int Main()
- {
- return IndexerWithRangeTest();
- }
-}
diff --git a/tests/src/JIT/Regression/JitBlue/GitHub_23411/GitHub_23411.il b/tests/src/JIT/Regression/JitBlue/GitHub_23411/GitHub_23411.il
index e6e508f0e3..e561026206 100644
--- a/tests/src/JIT/Regression/JitBlue/GitHub_23411/GitHub_23411.il
+++ b/tests/src/JIT/Regression/JitBlue/GitHub_23411/GitHub_23411.il
@@ -1,3 +1,7 @@
+// 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.
+
.assembly extern System.Runtime { }
.assembly extern System.Console { }
.assembly extern System.Globalization { }
diff --git a/tests/src/JIT/Regression/JitBlue/GitHub_23792/GitHub_23792.il b/tests/src/JIT/Regression/JitBlue/GitHub_23792/GitHub_23792.il
new file mode 100644
index 0000000000..9c63524e6f
--- /dev/null
+++ b/tests/src/JIT/Regression/JitBlue/GitHub_23792/GitHub_23792.il
@@ -0,0 +1,163 @@
+
+// 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.
+
+// This tests that
+// ((x+icon)+y) => ((x+y)+icon)
+// and
+// ((x+icon1)+(y+icon2)) => ((x+y)+(icon1+icon2))
+// transformations in morph don't create byrefs pointing outside of the ref object.
+// Method Run1 calculates (theRef - 8 + a -8 + b).
+// Before the fix morph transformed this to ((theRef + a) + b -16).
+// theRef + a may point outside of the object.
+// Method Run2 calculates ((theRef - 8) + (a - 8) + b).
+// Before the fix morph transformed this to ((theRef + a) + b -16).
+// theRef + a may point outside of the object.
+
+.assembly extern mscorlib{}
+.assembly extern System.Console{}
+.assembly a {}
+
+.class private auto ansi beforefieldinit Test
+ extends [mscorlib]System.Object
+{
+
+ //public static int Main()
+ //{
+ // byte size = 9;
+ // byte[] arr = new byte[9];
+ // for (byte i = 0; i < size; ++i)
+ // {
+ // arr[i] = i;
+ // }
+ // ref byte newRef1 = ref Run1(ref arr[8], (IntPtr)8, (IntPtr)8);
+ // ref byte newRef2 = ref Run2(ref arr[8], (IntPtr)8, (IntPtr)8);
+ // int result = 84 + newRef1 + newRef2;
+ // if (result == 100)
+ // {
+ // Console.WriteLine("PASS");
+ // }
+ // else
+ // {
+ // Console.WriteLine("FAIL");
+ // }
+ // return result;
+ //}
+
+ .method public hidebysig static int32 Main() cil managed
+ {
+ .entrypoint
+ // Code size 119 (0x77)
+ .maxstack 3
+ .locals init (uint8 V_0,
+ uint8[] V_1,
+ uint8& V_2,
+ uint8& V_3,
+ uint8 V_4)
+ IL_0000: ldc.i4.s 9
+ IL_0002: stloc.0
+ IL_0003: ldc.i4.s 9
+ IL_0005: newarr [mscorlib]System.Byte
+ IL_000a: stloc.1
+ IL_000b: ldc.i4.0
+ IL_000c: stloc.s V_4
+ IL_000e: br.s IL_001d
+ IL_0010: ldloc.1
+ IL_0011: ldloc.s V_4
+ IL_0013: ldloc.s V_4
+ IL_0015: stelem.i1
+ IL_0016: ldloc.s V_4
+ IL_0018: ldc.i4.1
+ IL_0019: add
+ IL_001a: conv.u1
+ IL_001b: stloc.s V_4
+ IL_001d: ldloc.s V_4
+ IL_001f: ldloc.0
+ IL_0020: blt.s IL_0010
+ IL_0022: ldloc.1
+ IL_0023: ldc.i4.8
+ IL_0024: ldelema [mscorlib]System.Byte
+ IL_0029: ldc.i4.8
+ IL_002a: call native int [mscorlib]System.IntPtr::op_Explicit(int32)
+ IL_002f: ldc.i4.8
+ IL_0030: call native int [mscorlib]System.IntPtr::op_Explicit(int32)
+ IL_0035: call uint8& Test::Run1(uint8&,
+ native int,
+ native int)
+ IL_003a: stloc.2
+ IL_003b: ldloc.1
+ IL_003c: ldc.i4.8
+ IL_003d: ldelema [mscorlib]System.Byte
+ IL_0042: ldc.i4.8
+ IL_0043: call native int [mscorlib]System.IntPtr::op_Explicit(int32)
+ IL_0048: ldc.i4.8
+ IL_0049: call native int [mscorlib]System.IntPtr::op_Explicit(int32)
+ IL_004e: call uint8& Test::Run2(uint8&,
+ native int,
+ native int)
+ IL_0053: stloc.3
+ IL_0054: ldc.i4.s 84
+ IL_0056: ldloc.2
+ IL_0057: ldind.u1
+ IL_0058: add
+ IL_0059: ldloc.3
+ IL_005a: ldind.u1
+ IL_005b: add
+ IL_005c: dup
+ IL_005d: ldc.i4.s 100
+ IL_005f: bne.un.s IL_006c
+ IL_0061: ldstr "PASS"
+ IL_0066: call void [System.Console]System.Console::WriteLine(string)
+ IL_006b: ret
+ IL_006c: ldstr "FAIL"
+ IL_0071: call void [System.Console]System.Console::WriteLine(string)
+ IL_0076: ret
+} // end of method Test::Main
+
+
+ .method private hidebysig static uint8&
+ Run1(uint8& theRef,
+ native int a,
+ native int b) cil managed noinlining
+ {
+ ldarg.0
+ ldc.i4 8
+ sub
+ ldarg.1
+ ldc.i4 8
+ sub
+ add
+ ldc.i4 8
+ add
+ ret
+ } // end of method Test::Run1
+
+ .method private hidebysig static uint8&
+ Run2(uint8& theRef,
+ native int a,
+ native int b) cil managed noinlining
+ {
+ ldarg.0
+ ldc.i4 -8
+ add
+ ldarg.1
+ ldc.i4 -8
+ add
+ add
+ ldarg.2
+ add
+ ret
+ } // end of method Test::Run2
+
+ .method public hidebysig specialname rtspecialname
+ instance void .ctor() cil managed
+ {
+ // Code size 7 (0x7)
+ .maxstack 8
+ IL_0000: ldarg.0
+ IL_0001: call instance void [mscorlib]System.Object::.ctor()
+ IL_0006: ret
+ } // end of method Test::.ctor
+
+} // end of class Test
diff --git a/tests/src/JIT/Regression/JitBlue/GitHub_23792/GitHub_23792.ilproj b/tests/src/JIT/Regression/JitBlue/GitHub_23792/GitHub_23792.ilproj
new file mode 100644
index 0000000000..1e33a02324
--- /dev/null
+++ b/tests/src/JIT/Regression/JitBlue/GitHub_23792/GitHub_23792.ilproj
@@ -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>
+ <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+ </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>None</DebugType>
+ <Optimize>True</Optimize>
+ </PropertyGroup>
+ <ItemGroup>
+ <Compile Include="GitHub_23792.il" />
+ </ItemGroup>
+ <ItemGroup>
+ <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+ </ItemGroup>
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+ <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+ </PropertyGroup>
+</Project>
diff --git a/tests/src/JIT/Regression/JitBlue/GitHub_23950/GitHub_23950.il b/tests/src/JIT/Regression/JitBlue/GitHub_23950/GitHub_23950.il
new file mode 100644
index 0000000000..f96e2cd3d7
--- /dev/null
+++ b/tests/src/JIT/Regression/JitBlue/GitHub_23950/GitHub_23950.il
@@ -0,0 +1,49 @@
+// 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.
+
+.assembly extern mscorlib {}
+
+.assembly GitHub_23970 {}
+
+// Test that jit can inline method with a pinned pointer
+
+.class public sequential ansi sealed beforefieldinit Program
+ extends [mscorlib]System.Object
+{
+ .method private hidebysig static
+ int32 Main (
+ string[] args
+ ) cil managed
+ {
+
+ .maxstack 1
+ .entrypoint
+ .locals init (
+ [0] int32
+ )
+ nop
+ ldc.i4.s 100
+ stloc.0
+ ldloca.s 0
+ call int32 Program::GetValueUnsafe(int32&)
+ ret
+ }
+
+ .method private hidebysig
+ static int32 GetValueUnsafe (
+ int32& buffer
+ ) cil managed
+ {
+ .maxstack 3
+ .locals init (
+ [0] int32* pinned
+ )
+
+ ldarg.0
+ stloc.0
+ ldloc.0
+ ldind.i4
+ ret
+ }
+} \ No newline at end of file
diff --git a/tests/src/JIT/Regression/JitBlue/GitHub_20958/GitHub_20958.csproj b/tests/src/JIT/Regression/JitBlue/GitHub_23950/GitHub_23950.ilproj
index d86ed9f3d7..43c02b93f7 100644
--- a/tests/src/JIT/Regression/JitBlue/GitHub_20958/GitHub_20958.csproj
+++ b/tests/src/JIT/Regression/JitBlue/GitHub_23950/GitHub_23950.ilproj
@@ -2,16 +2,24 @@
<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)' == '' ">Release</Configuration>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<AssemblyName>$(MSBuildProjectName)</AssemblyName>
+ <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
<OutputType>Exe</OutputType>
- <DebugType></DebugType>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+ <CLRTestPriority>0</CLRTestPriority>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "></PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "></PropertyGroup>
+ <PropertyGroup>
+ <DebugType>None</DebugType>
<Optimize>True</Optimize>
</PropertyGroup>
<ItemGroup>
- <Compile Include="$(MSBuildProjectName).cs" />
+ <Compile Include="GitHub_23950.il" />
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
- <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
-</Project> \ No newline at end of file
+ <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+ </PropertyGroup>
+</Project>