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-11-30 22:33:28 +0300
committerMarek Safar <marek.safar@gmail.com>2006-11-30 22:33:28 +0300
commit1a30b8a1e197b6d53874f5834b2a010deb406b00 (patch)
treeedc4a1c8de3d1c13d88a89555050caf8ee1b208a /mcs/tests/test-540.cs
parent205037c59db77db2baa20877f6bbe04c4b33d7ee (diff)
New test.
svn path=/trunk/mcs/; revision=68767
Diffstat (limited to 'mcs/tests/test-540.cs')
-rw-r--r--mcs/tests/test-540.cs69
1 files changed, 69 insertions, 0 deletions
diff --git a/mcs/tests/test-540.cs b/mcs/tests/test-540.cs
new file mode 100644
index 00000000000..977e14b07e9
--- /dev/null
+++ b/mcs/tests/test-540.cs
@@ -0,0 +1,69 @@
+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;
+
+ System.Console.WriteLine ("OK");
+ return 0;
+ }
+
+} \ No newline at end of file