forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding a regression test for dotnet#81585
- Loading branch information
1 parent
1671125
commit 22e79d8
Showing
2 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
src/tests/JIT/Regression/JitBlue/Runtime_81585/Runtime_81585.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System; | ||
using System.Numerics; | ||
using System.Runtime.CompilerServices; | ||
|
||
[module: SkipLocalsInit] | ||
|
||
class Runtime_81585 | ||
{ | ||
static int Main() | ||
{ | ||
Vector4 a = new Vector4(new Vector2(1.051f, 2.05f), 3.478f, 1.0f); | ||
Vector4 b = new Vector4(new Vector3(1.051f, 2.05f, 3.478f), 0.0f); | ||
b.W = 1.0f; | ||
|
||
float actual = Vector4.Distance(a, b); | ||
AssertEqual(0.0f, actual); | ||
return 100; | ||
} | ||
|
||
[MethodImpl(MethodImplOptions.NoInlining)] | ||
static void AssertEqual(float expected, float actual) | ||
{ | ||
if (expected != actual) | ||
{ | ||
throw new Exception($"Expected: {expected}; Actual: {actual}"); | ||
} | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/tests/JIT/Regression/JitBlue/Runtime_81585/Runtime_81585.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> | ||
<OutputType>Exe</OutputType> | ||
<Optimize>True</Optimize> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="$(MSBuildProjectName).cs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<CLRTestEnvironmentVariable Include="DOTNET_JitStress" Value="1" /> | ||
</ItemGroup> | ||
</Project> |