2009-02-19 Jb Evain <jbevain@novell.com>
[mono.git] / mcs / tests / gtest-335.cs
1 using System;
2
3 public class TestClass
4 {
5         public static bool Test_1 ()
6         {
7                 DayOfWeek? testEnum = DayOfWeek.Monday;
8                 switch (testEnum) {
9                         case DayOfWeek.Monday:
10                                 return true;
11                 }
12                 return false;
13         }
14         
15         public static bool Test_2 ()
16         {
17                 DayOfWeek? testEnum = null;
18                 switch (testEnum) {
19                         case DayOfWeek.Monday:
20                                 return false;
21                         case null:
22                                 return true;
23                         default:
24                                 return false;
25                 }
26         }
27
28         public static bool Test_3 ()
29         {
30                 DayOfWeek? testEnum = null;
31                 switch (testEnum) {
32                         case DayOfWeek.Monday:
33                                 return false;
34                         default:
35                                 return true;
36                 }
37         }
38
39         public static bool Test_4 ()
40         {
41                 DayOfWeek? testEnum = DayOfWeek.Monday;
42                 switch (testEnum) {
43                 }
44                 return true;
45         }
46         
47         public static int Main()
48         {
49                 if (!Test_1 ())
50                         return 1;
51                 if (!Test_2 ())
52                         return 2;
53                 if (!Test_3 ())
54                         return 3;
55                 if (!Test_4 ())
56                         return 4;
57
58                 Console.WriteLine ("OK");
59                 return 0;
60         }
61 }