[interp] Reduce computation under calc_section mutex
[mono-project.git] / mcs / tests / test-named-02.cs
blobf195fb18c066c97bcb2b8078e2db59dff8fd3573
1 using System;
3 class A
5 public int id;
7 public int this [int i] {
8 set { Console.WriteLine ("set= " + i); id = value; }
9 get { Console.WriteLine ("get= " + i); return id; }
13 struct MyPoint
15 public MyPoint (int x, int y)
17 X = x;
18 Y = y;
21 public int X, Y;
24 class C
26 static decimal Foo (decimal t, decimal a)
28 return a;
31 static string Bar (int a = 1, string s = "2", char c = '3')
33 return a.ToString () + s + c;
36 static int Test (int a, int b)
38 Console.WriteLine ("{0} {1}", a, b);
39 return a * 3 + b * 7;
42 public static int Main ()
44 int h;
45 if (Foo (a : h = 9, t : 3) != 9)
46 return 1;
48 if (h != 9)
49 return 2;
51 if (Bar (a : 1, s : "x", c : '2') != "1x2")
52 return 3;
54 if (Bar (s : "x") != "1x3")
55 return 4;
57 int i = 1;
58 if (Test (a: i++, b: i++) != 17)
59 return 5;
61 if (i != 3)
62 return 6;
64 i = 1;
65 if (Test (b: i++, a: i++) != 13)
66 return 7;
68 A a = new A ();
69 i = 5;
70 a [i:i++]++;
72 if (a.id != 1)
73 return 8;
75 if (i != 6)
76 return 9;
78 MyPoint mp = new MyPoint (y : -1, x : 5);
79 if (mp.Y != -1)
80 return 10;
82 Console.WriteLine ("ok");
83 return 0;