[msbuild] Bump msbuild, fix build breakage
[mono.git] / mcs / tests / test-504.cs
index 87c28794793a7e000578a03ff644ed199763ab4d..d99207e30c182c16e4cddf177e5f167281d28bd7 100644 (file)
@@ -1,7 +1,13 @@
-// Compiler options: -warnaserror
-
 // This ensures that any "unreachable code" warning will error out
-// rather than generate invalid IL
+// rather than generate invalid IL or crash compiler
+
+using System;
+
+public enum FooEnum
+{
+       One,
+       Two
+};
 
 class Foo
 {
@@ -20,4 +26,43 @@ class Foo
 
                return 1;
        }
+
+       public static string Test_2 ()
+       {
+               throw new Exception ();
+
+               var account = "yo";
+               if (account == null) {
+               }
+
+               var s = "yo";
+
+               switch (8) {
+               case 1:
+               case 2:
+                       break;
+               default:
+                       throw new NotSupportedException ();
+               }
+
+               return s;
+       }
+
+       const FooEnum foo = FooEnum.Two;
+
+       static void Test_3 ()
+       {
+               object obj;
+
+               switch (foo) {
+               case FooEnum.One:
+                       obj = new object ();
+                       break;
+               case FooEnum.Two:
+                       obj = new object ();
+                       break;
+               }
+
+               Console.WriteLine (obj);
+       }
 }