summaryrefslogtreecommitdiff
path: root/tests/src/JIT/jit64/regress/vsw/471729/test.cs
blob: 4585e760cfbe8b73c94c779cd138f15197d23527 (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
// 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 static class Repro
{
    private struct S
    {
        public bool b;
        public string s;
    }

    private static S ReturnsS()
    {
        S s = new S();
        s.b = true;
        s.s = "S";
        Console.WriteLine(s.s);
        return s;
    }

    private static void Test(bool f)
    {
        if (f)
        {
            throw new Exception(ReturnsS().s, new Exception(ReturnsS().s));
        }
        else
        {
            Console.WriteLine("blah");
        }
    }

    private static int Main()
    {
        int rc = 1;
        try
        {
            Test(true);
            Test(false);
        }
        catch
        {
            rc = 100;
        }

        return rc;
    }
}