X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Ftests%2Ftest-499.cs;h=f885c89379a1b6d09f845a8c7610ae9700e3fc01;hb=f815427d73444a80d0b0bf9a8c8605a8814200e8;hp=f6789aa4a3a528d2da62d14741ef544bc46f55e1;hpb=4eb352bcb3ef7a71dc9ab62c5cd2d5e7598619f7;p=mono.git diff --git a/mcs/tests/test-499.cs b/mcs/tests/test-499.cs index f6789aa4a3a..f885c89379a 100644 --- a/mcs/tests/test-499.cs +++ b/mcs/tests/test-499.cs @@ -1,10 +1,95 @@ -class X { - static void Main () +using System; + +class A +{ + static int switch1 (ulong a) + { + switch (a) { + case long.MaxValue - 1: + return 1; + case long.MaxValue + (ulong) 1: + return 2; + case long.MaxValue + (ulong) 2: + return 3; + case long.MaxValue + (ulong) 3: + break; + default: + return 4; + } + + return 5; + } + + static int switch2 (sbyte a) + { + switch (a) { + case 0: + return 1; + case -1: + return 2; + } + + return 0; + } + + static int switch3 (long a) + { + switch (a) { + case 0: + return 1; + case -1: + return 2; + } + + return 0; + } + + static int switch4 (ulong a) + { + switch (a) { + case long.MaxValue: + goto case ulong.MaxValue; + + case ulong.MaxValue: + return 4; + } + + return 0; + } + + static int switch5(ulong x) { - ulong x = 1; switch (x) { case 0: break; + default: + return 1; } + + return 2; + } + + public static int Main () + { + if (switch1 (long.MaxValue + (ulong) 1) != 2) + return 1; + + if (switch2 (-1) != 2) + return 2; + + if (switch3 (-1) != 2) + return 3; + + if (switch4 (ulong.MaxValue) != 4) + return 4; + + if (switch4 (long.MaxValue) != 4) + return 41; + + if (switch5 (0) != 2) + return 5; + + Console.WriteLine ("1"); + return 0; } -} +} \ No newline at end of file