summaryrefslogtreecommitdiff
path: root/tests/src/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b449827/b449827.cs
blob: 36ace80ea25162962b9e62c794284b315f61643e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System;

internal class MainApp
{
    public static int Main(string[] args)
    {
        int a, prev;

        Console.WriteLine("\n========== Case 1 (wrong result) ==========");

        a = 2044617152;
        Console.WriteLine("a1={0}", a);

        a += 0x12345678;

        if (a < 0) a = -a;
        Console.WriteLine("a2={0}", a);

        prev = a;
        Console.WriteLine("prev={0}, a2={1}", prev, a);

        Console.WriteLine("\n========== Case 2 (right result) ==========");

        a = 2044617152;
        Console.WriteLine("a1={0}", a);

        a += 0x12345678;
        a.ToString();

        if (a < 0) a = -a;
        Console.WriteLine("a2={0}", a);

        Console.WriteLine("prev={0}, a3={1}", prev, a);

        Console.WriteLine("\n========== Test Summary ==========");
        if (a == prev)
        {
            Console.WriteLine("Test SUCCESS");
            return 100;
        }
        else
        {
            Console.WriteLine("Test FAILED");
            return 101;
        }
    }
}