[corlib] Fix a few NSLogWriter issues. (#13799)
[mono-project.git] / mcs / tests / test-ref-04.cs
blobaf96f235ce7055c2a073dbbf9012d919f2c20138
1 class X
3 int field;
5 public static int Main ()
7 var x = new X ();
9 x.field = 5;
10 if (!x.Test1 ())
11 return 1;
13 x.Test2 ();
15 if (x.Test3 ()++ != 6)
16 return 2;
18 if (x.field != 7)
19 return 3;
21 return 0;
24 bool Test1 ()
26 ref var x = ref field;
27 int v = x;
28 ++x;
30 return x == 6;
33 void Test2 ()
35 ref int x = ref field;
36 x.ToString ();
39 ref int Test3 ()
41 ref int l = ref field;
42 ref int v = ref l;
43 return ref l;