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>2010-09-25 13:45:14 +0400
committerMarek Safar <marek.safar@gmail.com>2010-09-25 13:48:33 +0400
commit820c91d665bfe00bbc0d97854c6b31ca9dfa0e55 (patch)
treef2a3b959b44e5bba7143592a25e70328689e0b8c /mcs/tests/gtest-540.cs
parent35917fa067aa1b61b56be68d6cc179cda2f346bd (diff)
Implemented more combinations of nullable boolean logical operators
Diffstat (limited to 'mcs/tests/gtest-540.cs')
-rw-r--r--mcs/tests/gtest-540.cs91
1 files changed, 91 insertions, 0 deletions
diff --git a/mcs/tests/gtest-540.cs b/mcs/tests/gtest-540.cs
new file mode 100644
index 00000000000..8c9c43a1602
--- /dev/null
+++ b/mcs/tests/gtest-540.cs
@@ -0,0 +1,91 @@
+// lifted null binary operators
+
+using System;
+
+class C
+{
+ public static int Main ()
+ {
+ bool v;
+ v = (true & null) == null;
+ if (!v)
+ return 1;
+
+ v = (false & null) != null;
+ if (!v)
+ return 2;
+
+ v = (null & true) == null;
+ if (!v)
+ return 3;
+
+ v = (null & false) != null;
+ if (!v)
+ return 4;
+
+ v = (true | null) == null;
+ if (v != false)
+ return 11;
+
+ v = (false | null) != null;
+ if (v != false)
+ return 12;
+
+ v = (null | true) == null;
+ if (v != false)
+ return 13;
+
+ v = (null | false) != null;
+ if (v != false)
+ return 14;
+
+ v = (null & 1) == null;
+ if (v != true)
+ return 20;
+
+ v = (null & 0) != null;
+ if (v != false)
+ return 21;
+
+ bool? a = false;
+ bool? b = true;
+
+ if ((a & null) != false)
+ return 50;
+
+ if ((b & null) != null)
+ return 51;
+
+ if ((null & a) != false)
+ return 52;
+
+ if ((null & b) != null)
+ return 53;
+
+ if ((a & true) != false)
+ return 54;
+
+ if ((true & a) != false)
+ return 55;
+
+ if ((a | null) != null)
+ return 60;
+
+ if ((b | null) != true)
+ return 61;
+
+ if ((null | a) != null)
+ return 62;
+
+ if ((null | b) != true)
+ return 63;
+
+ if ((a | true) != true)
+ return 64;
+
+ if ((true | a) != true)
+ return 65;
+
+ return 0;
+ }
+} \ No newline at end of file