diff options
author | dotnet-bot <dotnet-bot@microsoft.com> | 2015-01-30 14:14:42 -0800 |
---|---|---|
committer | dotnet-bot <dotnet-bot@microsoft.com> | 2015-01-30 14:14:42 -0800 |
commit | ef1e2ab328087c61a6878c1e84f4fc5d710aebce (patch) | |
tree | dee1bbb89e9d722e16b0d1485e3cdd1b6c8e2cfa /tests/src/JIT/CodeGenBringUpTests/JTrueGtInt1.cs | |
download | coreclr-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/JTrueGtInt1.cs')
-rw-r--r-- | tests/src/JIT/CodeGenBringUpTests/JTrueGtInt1.cs | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/tests/src/JIT/CodeGenBringUpTests/JTrueGtInt1.cs b/tests/src/JIT/CodeGenBringUpTests/JTrueGtInt1.cs new file mode 100644 index 0000000000..7c8ad9f379 --- /dev/null +++ b/tests/src/JIT/CodeGenBringUpTests/JTrueGtInt1.cs @@ -0,0 +1,53 @@ +// 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; + + // This test method returns: + // 1 if x == int.MinValue + // 2 if int.MinValue < x < -1 + // 3 if x == -1 + // 4 if x == 0 + // 5 if x == 1 + // 6 if 1 < x < int.MaxValue + // 7 if x == int.MaxValue + + [MethodImplAttribute(MethodImplOptions.NoInlining)] + public static int JTrueGtInt1(int x) + { + int returnValue = -1; + + if (x > int.MaxValue) returnValue = 0; // Never true + else if (x > (int.MaxValue-1)) returnValue = 7; + else if (x > 1) returnValue = 6; + else if (x > 0) returnValue = 5; + else if (x > -1) returnValue = 4; + else if (x > (int.MinValue+1)) returnValue = 3; + else if (x > int.MinValue) returnValue = 2; + else returnValue = 1; + + return returnValue; + } + + public static int Main() + { + int returnValue = Pass; + + if (JTrueGtInt1(int.MinValue) != 1) returnValue = Fail; + if (JTrueGtInt1(int.MinValue+1) != 2) returnValue = Fail; + if (JTrueGtInt1(-1) != 3) returnValue = Fail; + if (JTrueGtInt1(0) != 4) returnValue = Fail; + if (JTrueGtInt1(1) != 5) returnValue = Fail; + if (JTrueGtInt1(int.MaxValue-1) != 6) returnValue = Fail; + if (JTrueGtInt1(int.MaxValue) != 7) returnValue = Fail; + + return returnValue; + } +} |