summaryrefslogtreecommitdiff
path: root/tests/src/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b72687/b72687.cs
blob: 28b0e6f2ae9dca7495896ce952b68a2990b50ed9 (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
52
53
54
55
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
internal unsafe class CSE2
{
    public static int sa = 2;
    public static int sb = 1;

    public struct VT
    {
        public double a0;
    }

    public class CL_5
    {
        public int[,] arr2d_5 = new int[3, 11];
    }

    public static double Func_5(CL_5 cl_5)
    {
        double retval_5 = -24;
        return retval_5;
    }

    public static long Func_4(long* a0_4)
    {
        long retval_4 = 6;
        return retval_4;
    }

    public static int Func(VT vt)
    {
        CL_5 cl_5 = new CL_5();
        cl_5.arr2d_5[2, 0] = sa * sb;
        double val_5 = Func_5(cl_5);

        long* a0_4 = stackalloc long[1];
        *a0_4 = sa + sb;
        long val_4 = Func_4(a0_4);

        int retval = Convert.ToInt32((val_5 - 8 * vt.a0) + (((sa + sb) - 5) / 2 + val_4));
        Console.WriteLine("retval is {0}", retval);
        return retval;
    }

    public static int Main()
    {
        VT vt = new VT();
        vt.a0 = -(sa + sb);
        int val = Func(vt);
        return val + 95;
    }
}