[mcs] Add codegen for null operator on result of awaited instance expression of prope...
[mono.git] / mcs / tests / gtest-optional-11.cs
index a97b41d6a4f2cf9d9c8f3eac761dfe355b3dd9d7..85b035de657ec22183e07e72896d62cdf5272d4e 100644 (file)
@@ -1,3 +1,5 @@
+// Compiler options: -r:gtest-optional-11-lib.dll
+
 using System;
 using System.Reflection;
 using System.Runtime.InteropServices;
@@ -19,6 +21,11 @@ public class C
                return a;
        }
 
+       public static int TestD ([Optional] int a, int i)
+       {
+               return a;
+       }
+
        public static int Main ()
        {
                if (TestA () != 1)
@@ -33,6 +40,29 @@ public class C
                if (TestC () != Missing.Value)
                        return 4;
                
+               if (TestD (i:2) != 0)
+                       return 5;
+               
+               if (Lib.TestA () != 1)
+                       return 11;
+
+               if (Lib.TestB (-4) != 0)
+                       return 12;
+
+               if (Lib.TestB ((object) null) != Missing.Value)
+                       return 13;
+
+               if (Lib.TestC () != Missing.Value)
+                       return 14;
+               
+               if (Lib.TestC2 () != null)
+                       return 15;
+               
+               if (Lib.TestD (i:2) != 0)
+                       return 16;
+               
+               Lib.TestS ();
+               
                return 0;
        }
 }