summaryrefslogtreecommitdiff
path: root/tests/src/JIT/Methodical/VT/etc/ctor_recurse.cs
blob: 9d8c5004cffa09465b29ff2f74e699e1b36bbf50 (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
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System;

namespace Test
{
    internal class S
    {
        private T _nvalue;
        public S(T t) { _nvalue = t; }
    }

    internal struct T
    {
        private static T s_stat;
        private S _gcref;

        public T(T t) { t.DoMethod(); _gcref = new S(t); }
        public T(S s) { _gcref = s; }

        private void DoMethod() { }

        private static int Main()
        {
            s_stat =
                new T(new S(new T(new S(new T(new S(new T(new S(new T(new S(
                new T(new S(new T(new S(new T(new S(new T(new S(new T(new S(
                new T(new S(new T(new S(new T(new S(new T(new S(new T(new S(
                new T(new S(new T(new S(new T(new S(new T(new S(new T(new S(
                new T(new S(new T(new S(new T(new S(new T(new S(new T(new S(
                new T(new S(new T(new S(new T(new S(new T(new S(new T(new S(
                        s_stat
                ))))))))))
                ))))))))))
                ))))))))))
                ))))))))))
                ))))))))))
                ))))))))))
                ;
            return 100;
        }
    }
}