From ef1e2ab328087c61a6878c1e84f4fc5d710aebce Mon Sep 17 00:00:00 2001 From: dotnet-bot Date: Fri, 30 Jan 2015 14:14:42 -0800 Subject: Initial commit to populate CoreCLR repo [tfs-changeset: 1407945] --- tests/src/JIT/CodeGenBringUpTests/FPMath.cs | 39 +++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 tests/src/JIT/CodeGenBringUpTests/FPMath.cs (limited to 'tests/src/JIT/CodeGenBringUpTests/FPMath.cs') diff --git a/tests/src/JIT/CodeGenBringUpTests/FPMath.cs b/tests/src/JIT/CodeGenBringUpTests/FPMath.cs new file mode 100644 index 0000000000..f896f367c0 --- /dev/null +++ b/tests/src/JIT/CodeGenBringUpTests/FPMath.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + + +using System; +using System.Runtime.CompilerServices; +public class BringUpTest +{ + const int Pass = 100; + const int Fail = -1; + + [MethodImplAttribute(MethodImplOptions.NoInlining)] + public static int FPMath() + { + double r = Math.Cos(0); + if (Math.Abs(r - 1d) <= Double.Epsilon) return Pass; + return Fail; + } + + [MethodImplAttribute(MethodImplOptions.NoInlining)] + public static double FPMath(double x) + { + return Math.Round(x); + + } + + public static int Main() + { + int result = FPMath(); + + if (result != Pass) return result; + + double r = FPMath(3.999d); + Console.WriteLine(r); + if (Math.Abs(r - 4d) <= Double.Epsilon) return Pass; + return Fail; + } +} -- cgit v1.2.3