2010-06-03 Jb Evain <jbevain@novell.com>
[mcs.git] / tests / test-540.cs
blobe417deafc160e230b8e1d7f7cd64024b7a0d8e09
1 class A
3 public static implicit operator byte (A mask)
5 return 22;
9 public class Constraint
11 const A lm = null;
13 enum E1 : int { A }
14 enum E2 : byte { A }
16 public static Constraint operator !(Constraint m)
18 return null;
21 public static Constraint operator +(Constraint m)
23 return null;
26 public static Constraint operator ~(Constraint m)
28 return null;
31 public static Constraint operator -(Constraint m)
33 return null;
36 static void Foo (object o)
40 public static int Main ()
43 Foo (!(Constraint)null);
44 Foo (~(Constraint)null);
45 Foo (+(Constraint)null);
46 Foo (-(Constraint)null);
48 const byte b1 = +0;
49 const byte b2 = +b1;
50 const byte b3 = (byte)0;
51 const int a = -2147483648;
52 const long l = -9223372036854775808;
53 const long l2 = -uint.MaxValue;
54 const E1 e = (E1)~E2.A;
56 unchecked {
57 if (-int.MinValue != int.MinValue)
58 return 1;
61 int b = -lm;
62 if (b != -22)
63 return 2;
65 uint ua = 2;
66 if (-ua != -2)
67 return 3;
69 System.Console.WriteLine ("OK");
70 return 0;