summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCarol Eidt <carol.eidt@microsoft.com>2018-08-01 21:59:18 -0700
committerGitHub <noreply@github.com>2018-08-01 21:59:18 -0700
commitde77d58b8418c787910bd5fd5fa8c1d9ad45663e (patch)
treeea1c342512043ecaf838c787ca952c1f99e37add /tests
parent87e9259abda877c2fb80ff54dc85f782e3c64df0 (diff)
downloadcoreclr-de77d58b8418c787910bd5fd5fa8c1d9ad45663e.tar.gz
coreclr-de77d58b8418c787910bd5fd5fa8c1d9ad45663e.tar.bz2
coreclr-de77d58b8418c787910bd5fd5fa8c1d9ad45663e.zip
Use 16 bytes to spill SIMD12 (#19237)
On 64-bit systems, SIMD12 locals are naturally rounded to 16 bytes, but the spill temp logic was not doing the same. Fix #19197
Diffstat (limited to 'tests')
-rw-r--r--tests/src/JIT/Regression/JitBlue/GitHub_19197/GitHub_19197.cs62
-rw-r--r--tests/src/JIT/Regression/JitBlue/GitHub_19197/GitHub_19197.csproj35
2 files changed, 97 insertions, 0 deletions
diff --git a/tests/src/JIT/Regression/JitBlue/GitHub_19197/GitHub_19197.cs b/tests/src/JIT/Regression/JitBlue/GitHub_19197/GitHub_19197.cs
new file mode 100644
index 0000000000..6d18e0f441
--- /dev/null
+++ b/tests/src/JIT/Regression/JitBlue/GitHub_19197/GitHub_19197.cs
@@ -0,0 +1,62 @@
+// 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 test was extracted from the corefx System.Numerics.Vectors tests,
+// and was failing with minOpts because a SIMD12 was being spilled using
+// a 16-byte load, but only a 12-byte location had been allocated.
+
+using System;
+using System.Numerics;
+
+public class GitHub_19171
+{
+ static int returnVal = 100;
+
+ static public void Vector3EqualsTest()
+ {
+ Vector3 a = new Vector3(1.0f, 2.0f, 3.0f);
+ Vector3 b = new Vector3(1.0f, 2.0f, 3.0f);
+
+ // case 1: compare between same values
+ object obj = b;
+
+ bool expected = true;
+ bool actual = a.Equals(obj);
+ Equal(expected, actual);
+
+ // case 2: compare between different values
+ b.X = 10.0f;
+ obj = b;
+ expected = false;
+ actual = a.Equals(obj);
+ Equal(expected, actual);
+
+ // case 3: compare between different types.
+ obj = new Quaternion();
+ expected = false;
+ actual = a.Equals(obj);
+ Equal(expected, actual);
+
+ // case 3: compare against null.
+ obj = null;
+ expected = false;
+ actual = a.Equals(obj);
+ Equal(expected, actual);
+ }
+
+ static void Equal(bool a, bool b)
+ {
+ Console.WriteLine(a == b ? "ok" : "bad");
+ if (a != b)
+ {
+ returnVal = -1;
+ }
+ }
+
+ public static int Main()
+ {
+ Vector3EqualsTest();
+ return returnVal;
+ }
+}
diff --git a/tests/src/JIT/Regression/JitBlue/GitHub_19197/GitHub_19197.csproj b/tests/src/JIT/Regression/JitBlue/GitHub_19197/GitHub_19197.csproj
new file mode 100644
index 0000000000..03a6a1e4a9
--- /dev/null
+++ b/tests/src/JIT/Regression/JitBlue/GitHub_19197/GitHub_19197.csproj
@@ -0,0 +1,35 @@
+<?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>{ADEEA3D1-B67B-456E-8F2B-6DCCACC2D34C}</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+ <CLRTestPriority>1</CLRTestPriority>
+ </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>Full</DebugType>
+ <Optimize>True</Optimize>
+ </PropertyGroup>
+ <ItemGroup>
+ <Compile Include="$(MSBuildProjectName).cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+ </ItemGroup>
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+ <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' "></PropertyGroup>
+</Project>