Skip to content

Commit

Permalink
Adding a regression test for dotnet#87116
Browse files Browse the repository at this point in the history
  • Loading branch information
tannergooding committed Jun 5, 2023
1 parent b27814c commit 12850c4
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/tests/JIT/Regression/JitBlue/Runtime_87116/Runtime_87116.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// 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.Runtime.CompilerServices;
using System.Runtime.Intrinsics;
using Xunit;

public class Runtime_87116
{
[Fact]
public static int Test()
{
return TryVectorAdd(1, 2, 1 + 2) ? 100 : 0;
}

[MethodImpl(MethodImplOptions.NoInlining)]
public static bool TryVectorAdd(float a, float b, float c)
{
Vector128<float> A = Vector128.Create(a);
Vector128<float> B = Vector128.Create(b);

Vector128<float> C = A + B;
return C == Vector128.Create(c);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Optimize>True</Optimize>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildProjectName).cs" />
</ItemGroup>
</Project>

0 comments on commit 12850c4

Please sign in to comment.