Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/runtime.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/JIT/HardwareIntrinsics/X86/Sse1/Sqrt.cs')
-rw-r--r--src/tests/JIT/HardwareIntrinsics/X86/Sse1/Sqrt.cs51
1 files changed, 6 insertions, 45 deletions
diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse1/Sqrt.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/Sqrt.cs
index bf6ca76b91e..063581499e8 100644
--- a/src/tests/JIT/HardwareIntrinsics/X86/Sse1/Sqrt.cs
+++ b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/Sqrt.cs
@@ -7,15 +7,14 @@ using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics.X86;
using System.Runtime.Intrinsics;
+using Xunit;
-namespace IntelHardwareIntrinsicTest
+namespace IntelHardwareIntrinsicTest._Sse1
{
- class Program
+ public partial class Program
{
- const int Pass = 100;
- const int Fail = 0;
-
- static unsafe int Main(string[] args)
+ [Fact]
+ public static unsafe void Sqrt()
{
int testResult = Pass;
@@ -46,45 +45,7 @@ namespace IntelHardwareIntrinsicTest
}
- return testResult;
+ Assert.Equal(Pass, testResult);
}
-
- public unsafe struct TestTable<T> : IDisposable where T : struct
- {
- public T[] inArray;
- public T[] outArray;
-
- public void* inArrayPtr => inHandle.AddrOfPinnedObject().ToPointer();
- public void* outArrayPtr => outHandle.AddrOfPinnedObject().ToPointer();
-
- GCHandle inHandle;
- GCHandle outHandle;
- public TestTable(T[] a, T[] b)
- {
- this.inArray = a;
- this.outArray = b;
-
- inHandle = GCHandle.Alloc(inArray, GCHandleType.Pinned);
- outHandle = GCHandle.Alloc(outArray, GCHandleType.Pinned);
- }
- public bool CheckResult(Func<T, T, bool> check)
- {
- for (int i = 0; i < inArray.Length; i++)
- {
- if (!check(inArray[i], outArray[i]))
- {
- return false;
- }
- }
- return true;
- }
-
- public void Dispose()
- {
- inHandle.Free();
- outHandle.Free();
- }
- }
-
}
}