Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mcs / tests / test-261.cs
1 using System;
2
3 class T {
4         T Me { get { calls ++; return this; } }
5         T GetMe () { foo ++; return this; }
6         int blah = 0, calls = 0, foo = 0, bar = 0;
7
8         static int Test (T t)
9         {
10                 t.Me.Me.blah ++;
11                 t.GetMe ().GetMe ().bar++;
12                 if (t.blah != 1)
13                         return 1;
14                 if (t.bar != 1)
15                         return 2;
16                 if (t.calls != 2)
17                         return 3;
18                 if (t.foo != 2)
19                         return 4;
20                 return 0;
21         }
22
23         public static int Main ()
24         {
25                 T t = new T ();
26                 int result = Test (t);
27                 Console.WriteLine ("RESULT: {0}", result);
28                 return result;
29         }
30 }