Merge pull request #487 from mayerwin/patch-1
[mono.git] / mcs / tests / gtest-optional-09.cs
1 using System;
2
3 public class Program
4 {
5         static int Test_1 (int i, sbyte s = 1)
6         {
7                 return 1;
8         }
9
10         static int Test_1<T> (T s)
11         {
12                 return 0;
13         }
14
15         static int Test_1 (int i, long s = 1)
16         {
17                 return 2;
18         }
19
20         static int Test_2 (short s)
21         {
22                 return 1;
23         }
24
25         static int Test_2 (int i, sbyte s = 1)
26         {
27                 return 0;
28         }
29
30         static int Test_3 (string s)
31         {
32                 return 0;
33         }
34
35         static int Test_3 (string s, sbyte s2 = 1)
36         {
37                 return 1;
38         }
39
40         static int Test_4 (object o = null)
41         {
42                 return 1;
43         }
44
45         static int Test_4 (params object[] a)
46         {
47                 return 0;
48         }
49
50         static int Test_5 ()
51         {
52                 return 0;
53         }
54
55         static int Test_5 (int i = 1, params object[] a)
56         {
57                 return 1;
58         }
59
60         static int Test_6 (params object[] o)
61         {
62                 return 0;
63         }
64
65         static int Test_6 (int i = 1, params object[] a)
66         {
67                 return 1;
68         }
69
70         static int Test_7 (bool b, params object[] o)
71         {
72                 return 0;
73         }
74
75         static int Test_7 (bool b, int i = 1, params object[] a)
76         {
77                 return 1;
78         }
79
80         public static int Main ()
81         {
82                 if (Test_1 (5) != 0)
83                         return 1;
84
85                 if (Test_2 (6) != 0)
86                         return 2;
87
88                 if (Test_3 ("") != 0)
89                         return 3;
90
91                 if (Test_4 (null) != 0)
92                         return 4;
93
94                 if (Test_5 () != 0)
95                         return 5;
96
97                 if (Test_6 () != 0)
98                         return 6;
99
100                 if (Test_7 (false) != 0)
101                         return 7;
102
103                 Console.WriteLine ("ok");
104                 return 0;
105         }
106 }