Correctly reapplied my last changes
authorMarek Safar <marek.safar@gmail.com>
Fri, 1 Dec 2006 18:58:20 +0000 (18:58 -0000)
committerMarek Safar <marek.safar@gmail.com>
Fri, 1 Dec 2006 18:58:20 +0000 (18:58 -0000)
svn path=/trunk/mcs/; revision=68839

mcs/tests/test-540.cs [new file with mode: 0644]

diff --git a/mcs/tests/test-540.cs b/mcs/tests/test-540.cs
new file mode 100644 (file)
index 0000000..adc6e3f
--- /dev/null
@@ -0,0 +1,73 @@
+class A\r
+{\r
+       public static implicit operator byte (A mask)\r
+       {\r
+               return 22;\r
+       }\r
+}\r
+\r
+public class Constraint\r
+{\r
+       const A lm = null;\r
+\r
+       enum E1 : int { A }\r
+       enum E2 : byte { A }\r
+\r
+       public static Constraint operator !(Constraint m)\r
+       {\r
+               return null;\r
+       }\r
+\r
+       public static Constraint operator +(Constraint m)\r
+       {\r
+               return null;\r
+       }\r
+\r
+       public static Constraint operator ~(Constraint m)\r
+       {\r
+               return null;\r
+       }\r
+\r
+       public static Constraint operator -(Constraint m)\r
+       {\r
+               return null;\r
+       }\r
+       \r
+       static void Foo (object o)\r
+       {\r
+       }\r
+       \r
+       public static int Main ()\r
+       {\r
+               \r
+               Foo (!(Constraint)null);\r
+               Foo (~(Constraint)null);\r
+               Foo (+(Constraint)null);\r
+               Foo (-(Constraint)null);\r
+               \r
+               const byte b1 = +0;\r
+               const byte b2 = +b1;\r
+               const byte b3 = (byte)0;\r
+               const int a = -2147483648;\r
+               const long l = -9223372036854775808;\r
+               const long l2 = -uint.MaxValue;\r
+               const E1 e = (E1)~E2.A;\r
+               \r
+               unchecked {\r
+                       if (-int.MinValue != int.MinValue)\r
+                               return 1;\r
+               }\r
+\r
+               int b = -lm;\r
+               if (b != -22)\r
+                       return 2;\r
+               \r
+               uint ua = 2;\r
+               if (-ua != -2)\r
+                       return 3;\r
+\r
+               System.Console.WriteLine ("OK");\r
+               return 0;\r
+       }\r
+       \r
+}
\ No newline at end of file