summaryrefslogtreecommitdiff
path: root/tests/src/JIT/CodeGenBringUpTests/FPConvF2I.cs
diff options
context:
space:
mode:
authordotnet-bot <dotnet-bot@microsoft.com>2015-01-30 14:14:42 -0800
committerdotnet-bot <dotnet-bot@microsoft.com>2015-01-30 14:14:42 -0800
commitef1e2ab328087c61a6878c1e84f4fc5d710aebce (patch)
treedee1bbb89e9d722e16b0d1485e3cdd1b6c8e2cfa /tests/src/JIT/CodeGenBringUpTests/FPConvF2I.cs
downloadcoreclr-ef1e2ab328087c61a6878c1e84f4fc5d710aebce.tar.gz
coreclr-ef1e2ab328087c61a6878c1e84f4fc5d710aebce.tar.bz2
coreclr-ef1e2ab328087c61a6878c1e84f4fc5d710aebce.zip
Initial commit to populate CoreCLR repo
[tfs-changeset: 1407945]
Diffstat (limited to 'tests/src/JIT/CodeGenBringUpTests/FPConvF2I.cs')
-rw-r--r--tests/src/JIT/CodeGenBringUpTests/FPConvF2I.cs36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/src/JIT/CodeGenBringUpTests/FPConvF2I.cs b/tests/src/JIT/CodeGenBringUpTests/FPConvF2I.cs
new file mode 100644
index 0000000000..d78471d99f
--- /dev/null
+++ b/tests/src/JIT/CodeGenBringUpTests/FPConvF2I.cs
@@ -0,0 +1,36 @@
+// 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 FPConvF2I(float x) { return (int) x; }
+
+ [MethodImplAttribute(MethodImplOptions.NoInlining)]
+ public static byte FPConvF2I(double x) { return (byte) x; }
+
+
+ public static int Main()
+ {
+ int result = Fail;
+ int x = FPConvF2I(3.14f);
+ Console.WriteLine(x);
+ if (x == 3) result = Pass;
+
+ int result2 = Fail;
+ byte y = FPConvF2I(3.14d);
+ Console.WriteLine(y);
+ if (y == 3) result2 = Pass;
+
+ if (result == Pass && result2 == Pass) return Pass;
+ return Fail;
+
+ }
+}