summaryrefslogtreecommitdiff
path: root/tests/src/JIT/Regression/CLR-x86-JIT/dev10/b402701/b402701.cs
blob: 81b555dd3195d86ea7fd9c54ab1966194b5d55f1 (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
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System;
using System.Security;


internal class Foo
{
    public virtual void callee()
    {
        Console.WriteLine("callee");
    }

    public static void caller(object o)
    {
        if (o == null)
            return;
        if (o.GetType() == typeof(Foo))
        {
            ((Foo)o).callee();
        }
    }

    public static int Main()
    {
        Foo f = new Foo();
        caller(f);

        Console.WriteLine("test passed");
        return 100;
    }
}