[mcs] Initial by ref returns and variables support
[mono.git] / mcs / tests / test-ref-01.cs
1 // Compiler options: -unsafe
2
3 public unsafe class X
4 {
5         int field;
6         int* ufield;
7
8         public static void Main ()
9         {
10                 int i = 5;
11                 ref int j = ref i;
12
13                 var x = new X ();
14                 ref var v = ref x.TestMethod ();
15         }
16
17         ref int TestMethod ()
18         {
19                 return ref field;
20         }
21
22         ref int TestProperty {
23                 get {
24                         return ref field;
25                 }
26         }
27
28         ref int this [long arg] {
29                 get {
30                         return ref field;
31                 }
32         }
33
34         unsafe ref int* Foo ()
35         {
36                 return ref ufield;
37         }
38 }