summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCarol Eidt <carol.eidt@microsoft.com>2018-12-18 15:13:07 -0800
committerCarol Eidt <carol.eidt@microsoft.com>2018-12-18 15:13:07 -0800
commitba3b4025a6974e5266181760003cf7552f8ae199 (patch)
tree3e09bb7cc61726988271cbe349c25253d07838cb /tests
parent05d3e8eac6cfd340424efb8f906b8cdb8e8a6bfe (diff)
downloadcoreclr-ba3b4025a6974e5266181760003cf7552f8ae199.tar.gz
coreclr-ba3b4025a6974e5266181760003cf7552f8ae199.tar.bz2
coreclr-ba3b4025a6974e5266181760003cf7552f8ae199.zip
Transform SIMD8 to FIELD_LIST if promoted
Fix #21546
Diffstat (limited to 'tests')
-rw-r--r--tests/src/JIT/Regression/JitBlue/GitHub_21546/GitHub_21546.cs78
-rw-r--r--tests/src/JIT/Regression/JitBlue/GitHub_21546/GitHub_21546.csproj33
2 files changed, 111 insertions, 0 deletions
diff --git a/tests/src/JIT/Regression/JitBlue/GitHub_21546/GitHub_21546.cs b/tests/src/JIT/Regression/JitBlue/GitHub_21546/GitHub_21546.cs
new file mode 100644
index 0000000000..1d94212921
--- /dev/null
+++ b/tests/src/JIT/Regression/JitBlue/GitHub_21546/GitHub_21546.cs
@@ -0,0 +1,78 @@
+// 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.Collections.Generic;
+using System.Linq;
+using System.Runtime.CompilerServices;
+
+using Point = System.Numerics.Vector2;
+
+namespace GitHub_21546
+{
+ public class test
+ {
+ static Point checkA;
+ static Point checkB;
+ static Point checkC;
+ static int returnVal;
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ static void check(Point a, Point b, Point c)
+ {
+ if (a != checkA)
+ {
+ Console.WriteLine($"A doesn't match. Should be {checkA} but is {a}");
+ returnVal = -1;
+ }
+ if (b != checkB)
+ {
+ Console.WriteLine($"B doesn't match. Should be {checkB} but is {b}");
+ returnVal = -1;
+ }
+ if (c != checkC)
+ {
+ Console.WriteLine($"C doesn't match. Should be {checkC} but is {c}");
+ returnVal = -1;
+ }
+ }
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ static void FailureCase(List<Point> p)
+ {
+ Point p1 = p[0];
+ Point p2 = p.Last();
+
+ check(p1, p[1], p2);
+ check(p1, p[1], p2);
+ check(p1, p[1], p2);
+ }
+
+ static Point NextPoint(Random random)
+ {
+ return new Point(
+ (float)random.NextDouble(),
+ (float)random.NextDouble()
+ );
+ }
+
+ static int Main()
+ {
+ returnVal = 100;
+ Random random = new Random(13);
+ List<Point> p = new List<Point>();
+
+ checkA = NextPoint(random);
+ p.Add(checkA);
+ checkB = NextPoint(random);
+ p.Add(checkB);
+ checkC = NextPoint(random);
+ p.Add(checkC);
+
+ FailureCase(p);
+
+ return returnVal;
+ }
+ }
+}
diff --git a/tests/src/JIT/Regression/JitBlue/GitHub_21546/GitHub_21546.csproj b/tests/src/JIT/Regression/JitBlue/GitHub_21546/GitHub_21546.csproj
new file mode 100644
index 0000000000..42f8a01f39
--- /dev/null
+++ b/tests/src/JIT/Regression/JitBlue/GitHub_21546/GitHub_21546.csproj
@@ -0,0 +1,33 @@
+<?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>{2649FAFE-07BF-4F93-8120-BA9A69285ABB}</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>
+ <PropertyGroup>
+ <DebugType>None</DebugType>
+ <Optimize>True</Optimize>
+ </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="$(MSBuildProjectName).cs" />
+ </ItemGroup>
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+ <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+</Project> \ No newline at end of file