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>2008-04-11 20:16:54 +0400
committerMarek Safar <marek.safar@gmail.com>2008-04-11 20:16:54 +0400
commit82301d35537e2c4ab94da36f3c0e2874e13e1512 (patch)
treecfbfc45f4044a962f4d91f3b9822b90c5b0bcd68 /mcs/tests/gtest-383.cs
parent5484963e4781c10ae2f8c187b779d4f5b04adfcd (diff)
New tests.
svn path=/trunk/mcs/; revision=100448
Diffstat (limited to 'mcs/tests/gtest-383.cs')
-rw-r--r--mcs/tests/gtest-383.cs105
1 files changed, 105 insertions, 0 deletions
diff --git a/mcs/tests/gtest-383.cs b/mcs/tests/gtest-383.cs
new file mode 100644
index 00000000000..0f73b5e429d
--- /dev/null
+++ b/mcs/tests/gtest-383.cs
@@ -0,0 +1,105 @@
+using System;
+
+struct MyTypeA
+{
+ short b;
+
+ public MyTypeA (short b)
+ {
+ this.b = b;
+ }
+
+ public static MyTypeA operator + (MyTypeA a, MyTypeA b)
+ {
+ throw new NotSupportedException ();
+ }
+
+ public static bool operator == (MyTypeA a, MyTypeA b)
+ {
+ return true;
+ }
+
+ public static bool operator != (MyTypeA a, MyTypeA b)
+ {
+ throw new NotSupportedException ();
+ }
+
+ public static bool operator > (MyTypeA a, MyTypeA b)
+ {
+ throw new NotSupportedException ();
+ }
+
+ public static bool operator < (MyTypeA a, MyTypeA b)
+ {
+ throw new NotSupportedException ();
+ }
+}
+
+struct MyTypeB
+{
+ short b;
+
+ public MyTypeB (short b)
+ {
+ this.b = b;
+ }
+
+ public static MyTypeB operator + (MyTypeB a, MyTypeB b)
+ {
+ return a;
+ }
+
+ public static bool operator == (MyTypeB a, MyTypeB b)
+ {
+ return true;
+ }
+
+ public static bool operator != (MyTypeB a, MyTypeB b)
+ {
+ return false;
+ }
+
+ public static bool operator > (MyTypeB a, MyTypeB b)
+ {
+ return false;
+ }
+
+ public static bool operator < (MyTypeB a, MyTypeB b)
+ {
+ return true;
+ }
+
+ public static MyTypeB operator & (MyTypeB a, MyTypeB b)
+ {
+ return a;
+ }
+}
+
+class C
+{
+ static int Main ()
+ {
+ MyTypeA? mt = null;
+ mt = null + mt;
+
+ MyTypeA? mt2 = null;
+ mt2 = mt2 + null;
+ bool b = mt2 > null;
+ bool x = mt2 == null;
+
+ MyTypeB? bt = null;
+ bt = bt + bt;
+ if (bt != null)
+ return 2;
+
+ MyTypeB? b2 = null;
+ bool bb = b2 == b2;
+ if (!bb)
+ return 3;
+
+ MyTypeB? b3 = null;
+ b3 = b3 & b3;
+ return 0;
+ }
+}
+