Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Safar <marek.safar@gmail.com>2006-12-01 21:58:20 +0300
committerMarek Safar <marek.safar@gmail.com>2006-12-01 21:58:20 +0300
commit102b31c5b3546c9c339889e654da4e08ec914589 (patch)
tree57b97fc3f7b954287ede5b3dcaa23510ef88b66b /mcs/tests/test-540.cs
parent782d2bc71933ae30bc1fcb0855186e9c17bd36da (diff)
Correctly reapplied my last changes
svn path=/trunk/mcs/; revision=68839
Diffstat (limited to 'mcs/tests/test-540.cs')
-rw-r--r--mcs/tests/test-540.cs73
1 files changed, 73 insertions, 0 deletions
diff --git a/mcs/tests/test-540.cs b/mcs/tests/test-540.cs
new file mode 100644
index 00000000000..adc6e3faea5
--- /dev/null
+++ b/mcs/tests/test-540.cs
@@ -0,0 +1,73 @@
+class A
+{
+ public static implicit operator byte (A mask)
+ {
+ return 22;
+ }
+}
+
+public class Constraint
+{
+ const A lm = null;
+
+ enum E1 : int { A }
+ enum E2 : byte { A }
+
+ public static Constraint operator !(Constraint m)
+ {
+ return null;
+ }
+
+ public static Constraint operator +(Constraint m)
+ {
+ return null;
+ }
+
+ public static Constraint operator ~(Constraint m)
+ {
+ return null;
+ }
+
+ public static Constraint operator -(Constraint m)
+ {
+ return null;
+ }
+
+ static void Foo (object o)
+ {
+ }
+
+ public static int Main ()
+ {
+
+ Foo (!(Constraint)null);
+ Foo (~(Constraint)null);
+ Foo (+(Constraint)null);
+ Foo (-(Constraint)null);
+
+ const byte b1 = +0;
+ const byte b2 = +b1;
+ const byte b3 = (byte)0;
+ const int a = -2147483648;
+ const long l = -9223372036854775808;
+ const long l2 = -uint.MaxValue;
+ const E1 e = (E1)~E2.A;
+
+ unchecked {
+ if (-int.MinValue != int.MinValue)
+ return 1;
+ }
+
+ int b = -lm;
+ if (b != -22)
+ return 2;
+
+ uint ua = 2;
+ if (-ua != -2)
+ return 3;
+
+ System.Console.WriteLine ("OK");
+ return 0;
+ }
+
+} \ No newline at end of file