codeowners update
[mono.git] / mcs / tests / gtest-optional-11.cs
1 // Compiler options: -r:gtest-optional-11-lib.dll
2
3 using System;
4 using System.Reflection;
5 using System.Runtime.InteropServices;
6
7 public class C
8 {
9         public static int TestA ([Optional][DefaultParameterValue (1)] int u)
10         {
11                 return u;
12         }
13
14         public static T TestB<T> (T a, [Optional] T u)
15         {
16                 return u;
17         }
18         
19         public static object TestC ([Optional] object a)
20         {
21                 return a;
22         }
23
24         public static int TestD ([Optional] int a, int i)
25         {
26                 return a;
27         }
28
29         public static int Main ()
30         {
31                 if (TestA () != 1)
32                         return 1;
33
34                 if (TestB (-4) != 0)
35                         return 2;
36
37                 if (TestB ((object) null) != Missing.Value)
38                         return 3;
39
40                 if (TestC () != Missing.Value)
41                         return 4;
42                 
43                 if (TestD (i:2) != 0)
44                         return 5;
45                 
46                 if (Lib.TestA () != 1)
47                         return 11;
48
49                 if (Lib.TestB (-4) != 0)
50                         return 12;
51
52                 if (Lib.TestB ((object) null) != Missing.Value)
53                         return 13;
54
55                 if (Lib.TestC () != Missing.Value)
56                         return 14;
57                 
58                 if (Lib.TestC2 () != null)
59                         return 15;
60                 
61                 if (Lib.TestD (i:2) != 0)
62                         return 16;
63                 
64                 Lib.TestS ();
65                 
66                 return 0;
67         }
68 }