More tests.
authorMarek Safar <marek.safar@gmail.com>
Wed, 20 Feb 2008 17:29:30 +0000 (17:29 -0000)
committerMarek Safar <marek.safar@gmail.com>
Wed, 20 Feb 2008 17:29:30 +0000 (17:29 -0000)
svn path=/trunk/mcs/; revision=96276

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

index 39f01b63eae7f6f2a06c211dee6fe6c47d4ace77..ef2ae26bef4ff09e4bea376e6bf170303ff02c2b 100644 (file)
@@ -1,5 +1,3 @@
-// Compiler options: -nowarn:0162
-
 class Program
 {
        static int Main ()
@@ -8,10 +6,13 @@ class Program
 
                if ((++ctc_f == 0 && false)) {
                        return 1;
+               } else if (false && +ctc_f == 0) {
+                       return 2;
                } else {
                        if (ctc_f != 1) {
-                               return 2;
+                               return 3;
                        }
+                       
                        return 0;
                }
        }
diff --git a/mcs/tests/test-614.cs b/mcs/tests/test-614.cs
new file mode 100644 (file)
index 0000000..78b549a
--- /dev/null
@@ -0,0 +1,53 @@
+using System;
+
+class C {
+
+       public static int       value;
+               
+       static internal void And ()
+       {       
+               if ((false & (value++ == 1)) != (false & (++value == 1)))
+                       return;
+               
+               if (((value++ == 1) & false) != ((++value == 1) & false))
+                       return;
+               
+               if ((false && (value++ == 1)) != (false && (++value == 1)))
+                       return;
+               
+               if (((value++ == 1) && false) != ((++value == 1) && false))
+                       return;
+       }
+
+       static internal void Or ()
+       {       
+               if ((false | (value++ == 1)) != (false | (++value == 1)))
+                       return;
+               
+               if (((value++ == 1) | false) != ((++value == 1) | false))
+                       return;
+               
+               if ((true || (value++ == 1)) != (true || (++value == 1)))
+                       return;
+               
+               if (((value++ == 1) || true) != ((++value == 1) || true))
+                       return;
+       }
+       
+       static int Main ()
+       {
+               value = 0;
+               And ();
+               Console.WriteLine (value);
+               if (value != 6)
+                       return 1;
+               
+               value = 0;
+               Or ();
+               Console.WriteLine (value);
+               if (value != 6)
+                       return 2;
+                       
+               return 0;
+       }
+}