From f4a6aab7c3db813a6ce279f438bd5b04e6f7f5cc Mon Sep 17 00:00:00 2001 From: Carol Eidt Date: Mon, 17 Dec 2018 10:28:54 -0800 Subject: [PATCH] Test for dotnet/coreclr#20657 SIMD byref bug Commit migrated from https://github.com/dotnet/coreclr/commit/4c428afcde2b9b16f202e864d3ac863ede3dff8f --- .../JitBlue/GitHub_20657/GitHub_20657.cs | 34 ++++++++++++++++++++++ .../JitBlue/GitHub_20657/GitHub_20657.csproj | 34 ++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_20657/GitHub_20657.cs create mode 100644 src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_20657/GitHub_20657.csproj diff --git a/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_20657/GitHub_20657.cs b/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_20657/GitHub_20657.cs new file mode 100644 index 0000000..b301cfd --- /dev/null +++ b/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_20657/GitHub_20657.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.Numerics; + +// GitHub 20657: + +namespace GitHub_20657 +{ + class Program + { + static int Main(string[] args) + { + var v1 = new Vector4(); + var v2 = Oops(v1); + if ((v2.X != 0.0) || (v2.Y != 0.0) || (v2.Z != 0.0) || (v2.W != 1.0)) + { + return -1; + } + return 100; + } + + private static readonly Vector4 Noo = new Vector4(); + + public static Vector4 Oops(Vector4 v) + { + v.W = 1f; + + return v + Noo; + } + } +} diff --git a/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_20657/GitHub_20657.csproj b/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_20657/GitHub_20657.csproj new file mode 100644 index 0000000..e191e012 --- /dev/null +++ b/src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_20657/GitHub_20657.csproj @@ -0,0 +1,34 @@ + + + + + Debug + AnyCPU + $(MSBuildProjectName) + 2.0 + {95DFC527-4DC1-495E-97D7-E94EE1F7140D} + Exe + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + ..\..\ + + + + + + + False + + + + None + True + + + + + + + + + + -- 2.7.4