[jit] Fix the saving of the 'cfg->ret_var_set' flag when inlining, it was set to...
[mono.git] / mcs / tests / test-named-02.cs
1 using System;
2
3 class A
4 {
5         public int id;
6         
7         public int this [int i] {
8                 set { Console.WriteLine ("set= " + i); id = value; }
9                 get { Console.WriteLine ("get= " + i); return id; }
10         }
11 }
12
13 struct MyPoint
14 {
15         public MyPoint (int x, int y)
16         {
17                 X = x;
18                 Y = y;
19         }
20         
21         public int X, Y;
22 }
23
24 class C
25 {
26         static decimal Foo (decimal t, decimal a)
27         {
28                 return a;
29         }
30         
31         static string Bar (int a = 1, string s = "2", char c = '3')
32         {
33                 return a.ToString () + s + c;
34         }
35
36         static int Test (int a, int b)
37         {
38                 Console.WriteLine ("{0} {1}", a, b);
39                 return a * 3 + b * 7;
40         }
41         
42         public static int Main ()
43         {
44                 int h;
45                 if (Foo (a : h = 9, t : 3) != 9)
46                         return 1;
47                 
48                 if (h != 9)
49                         return 2;
50                 
51                 if (Bar (a : 1, s : "x", c : '2') != "1x2")
52                         return 3;
53                 
54                 if (Bar (s : "x") != "1x3")
55                         return 4;
56                 
57                 int i = 1;
58                 if (Test (a: i++, b: i++) != 17)
59                         return 5;
60                 
61                 if (i != 3)
62                         return 6;
63                 
64                 i = 1;
65                 if (Test (b: i++, a: i++) != 13)
66                         return 7;
67                 
68                 A a = new A ();
69                 i = 5;
70                 a [i:i++]++;
71                 
72                 if (a.id != 1)
73                         return 8;
74                 
75                 if (i != 6)
76                         return 9;
77                 
78                 MyPoint mp = new MyPoint (y : -1, x : 5);
79                 if (mp.Y != -1)
80                         return 10;
81                 
82                 Console.WriteLine ("ok");
83                 return 0;
84         }
85 }