cleol
[mcs.git] / tests / test-named-04.cs
blobd9336d938b9ed404845024440b021beb32e64c39
1 using System;
3 struct S
5 public int Foo;
8 class Program
10 static void Foo2 (int a, ref int b)
12 Console.WriteLine (a);
13 Console.WriteLine (b);
15 if (a != 0 || b != 0)
16 throw new ApplicationException ();
18 b = 500;
21 public static int Main ()
23 var a = new S [] { new S (), new S (), new S () };
24 int i = 1;
25 Foo2 (b: ref a[i].Foo, a: a[++i].Foo++);
27 Console.WriteLine (a[0].Foo);
28 Console.WriteLine (a[1].Foo);
29 Console.WriteLine (a[2].Foo);
31 if (a [0].Foo != 0)
32 return 1;
34 if (a [1].Foo != 500)
35 return 2;
37 if (a [2].Foo != 1)
38 return 3;
40 return 0;