[System.Data] Try to fix random DataViewTest.DefaultColumnNameAddListChangedTest...
[mono-project.git] / mcs / tests / test-pattern-02.cs
blob695775ec17939daa00e130e0fa5aeced6da913d1
1 // Compiler options: -langversion:experimental
3 using System;
5 enum MyEnum : short
7 V_4 = 4
10 class ConstantPattern
12 static bool Generic<T> (T t) where T : class
14 return t is default (T);
17 public static int Main ()
19 bool b4 = false;
20 b4 = !b4;
21 object o = "x";
22 bool r1 = o is "y";
23 if (r1)
24 return 1;
26 r1 = o is "x";
27 if (!r1)
28 return 2;
30 string s = "o";
31 if (s is null)
32 return 3;
34 if (s is "oo")
35 return 4;
37 if (!(s is "o"))
38 return 5;
40 int? o3 = 4;
41 bool r3 = o3 is null;
42 if (r3)
43 return 6;
45 r3 = o3 is 4;
46 if (!r3)
47 return 7;
49 object o4 = (byte?)255;
50 var ggg = o4 is 255;
51 if (!ggg)
52 return 8;
54 if (o4 is null)
55 return 9;
57 object o5 = (double)-255;
58 if (!(o5 is -byte.MaxValue))
59 return 10;
61 object o6 = MyEnum.V_4;
62 bool r4 = o6 is 4;
63 if (r4)
64 return 11;
66 r4 = o6 is MyEnum.V_4;
67 if (!r4)
68 return 12;
70 ConstantPattern o7 = new ConstantPattern ();
71 if (!(o7 is ConstantPattern))
72 return 13;
74 if (!(o7 is object))
75 return 14;
77 object o8 = true;
78 if (o8 is false)
79 return 15;
81 if (!(o8 is true))
82 return 16;
84 if (Generic (""))
85 return 17;
87 if (!Generic<Delegate> (null))
88 return 18;
90 Console.WriteLine ("ok");
91 return 0;