Skip to content

Commit

Permalink
Add test for dotnet#38162
Browse files Browse the repository at this point in the history
  • Loading branch information
echesakov committed Oct 4, 2021
1 parent ca4ffa8 commit 2a78fcb
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/tests/JIT/Regression/JitBlue/Runtime_38162/Runtime_38162.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// 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.Reflection;
using System.Numerics;

namespace Runtime_38162
{
class Program
{
static int Main(string[] args)
{
bool directCall = Vector.IsHardwareAccelerated;
bool reflectionCall = (bool)typeof(Vector).InvokeMember(nameof(Vector.IsHardwareAccelerated), BindingFlags.GetProperty, null, null, new object[0]);

if (directCall != reflectionCall)
{
Console.WriteLine($"Direct call to Vector.IsHardwareAccelerated returns {directCall}");
Console.WriteLine($"Reflection call to Vector.IsHardwareAccelerated returns {reflectionCall}");
return 1;
}

return 100;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<DebugType />
<Optimize>True</Optimize>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildProjectName).cs" />
</ItemGroup>
</Project>

0 comments on commit 2a78fcb

Please sign in to comment.