summaryrefslogtreecommitdiff
path: root/tests/src/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b28037/b28037.cs
blob: 33e75d58c94928eb7aa5be550685fefbb5240927 (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
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//

/*
COMPILE THIS WITH OPTIMIZATION TURNED OFF:
coolc /o- bug.cs
*/
namespace Test
{
    using System;

    class AA
    {
        static int m_nStatic1 = 0;

        static void BlowUp() { throw new Exception(); }

        static void Method1(int[] param1)
        {
            float[] local3 = new float[2];
            for (; true; param1 = param1)
            {
                if (false)
                    GC.Collect();
                if (m_nStatic1 >= param1[2])
                    BlowUp();
            }
        }

        static int Main()
        {
            try
            {
                Method1(null);
            }
            catch (Exception) { }
            return 100;
        }
    }
}