[mcs] Add codegen for null operator on result of awaited instance expression of prope...
[mono.git] / mcs / tests / test-154.cs
index 585bf29b76054d3cf2453ddf2b6fa07c59e86bfb..163e78d135caac1dba6b75fb7836b8a5b3886bde 100644 (file)
@@ -294,7 +294,7 @@ public class X
                 } finally {
                         fin = 1;
                 }
-                return res;
+                return fin;
         }
 
        // from bug #30487.
@@ -515,4 +515,127 @@ public class X
         end:
                x = y;
        }
+
+       //
+       // Bug 46640
+       //
+       public static void test35 (int a, bool test)
+       {
+               switch (a) {
+               case 3:
+                       if (test)
+                               break;
+                       return;
+               default:
+                       return;
+               }
+       }
+
+       //
+       // Bug 52625
+       //
+       public static void test36 ()
+       {
+               string myVar;
+               int counter = 0;
+
+               while (true)
+               {
+                       if (counter < 3)
+                               counter++;
+                       else {
+                               myVar = "assigned";
+                               break;
+                       }
+               }
+               Console.WriteLine (myVar);
+       }
+
+       //
+       // Bug 58322
+       //
+       public static void test37 ()
+       {
+               int x = 0;
+               int y = 0;
+               switch (x) {
+               case 0:
+                       switch (y) {
+                       case 0:
+                               goto k_0;
+                       default:
+                               throw new Exception ();
+                       }
+               }
+
+       k_0:
+               ;
+       }
+
+       //
+       // Bug 59429
+       //
+       public static int test38 ()
+       {
+               return 0;
+       foo:
+               ;
+       }
+
+       static int test40 (int stop)
+       {
+               int service;
+
+               int pos = 0;
+               do {
+                       service = 1;
+                       break;
+               } while (pos < stop);
+
+               return service;
+       }
+
+       public void test41 ()
+       {
+               int y, x = 3;
+               int z;
+               while (true) {
+                       if (x > 3) {
+                               y = 3;
+                               goto end;
+                       } else {
+                               z = 3;
+                       }
+
+                       break;
+               end:
+                       z = y;
+               }
+
+               Console.WriteLine (z);
+       }
+       
+       public void test42 (int arg)
+       {
+               bool x;
+               for (; ; ) {
+                       x = false;
+                       if (arg > 0) {
+                               x = true;
+                               switch (arg) {
+                               case 1:
+                               case 2:
+                                       continue;
+                               default:
+                                       break;
+                               }
+                               break;
+                       } else {
+                               x = false;
+                               break;
+                       }
+               }
+
+               Console.WriteLine (x);
+       }
 }