summaryrefslogtreecommitdiffstats
path: root/contrib/perl5/t/op/inc.t
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/perl5/t/op/inc.t')
-rwxr-xr-xcontrib/perl5/t/op/inc.t53
1 files changed, 49 insertions, 4 deletions
diff --git a/contrib/perl5/t/op/inc.t b/contrib/perl5/t/op/inc.t
index e5a2a92..f59115e 100755
--- a/contrib/perl5/t/op/inc.t
+++ b/contrib/perl5/t/op/inc.t
@@ -1,9 +1,6 @@
#!./perl
-
-# $RCSfile$
-
-print "1..6\n";
+print "1..12\n";
# Verify that addition/subtraction properly upgrade to doubles.
# These tests are only significant on machines with 32 bit longs,
@@ -50,3 +47,51 @@ if ($a == -2147483649)
{print "ok 6\n"}
else
{print "not ok 6\n";}
+
+$a = 2147483648;
+$a = -$a;
+$c=$a--;
+if ($a == -2147483649)
+ {print "ok 7\n"}
+else
+ {print "not ok 7\n";}
+
+$a = 2147483648;
+$a = -$a;
+$c=--$a;
+if ($a == -2147483649)
+ {print "ok 8\n"}
+else
+ {print "not ok 8\n";}
+
+$a = 2147483648;
+$a = -$a;
+$a=$a-1;
+if ($a == -2147483649)
+ {print "ok 9\n"}
+else
+ {print "not ok 9\n";}
+
+$a = 2147483648;
+$b = -$a;
+$c=$b--;
+if ($b == -$a-1)
+ {print "ok 10\n"}
+else
+ {print "not ok 10\n";}
+
+$a = 2147483648;
+$b = -$a;
+$c=--$b;
+if ($b == -$a-1)
+ {print "ok 11\n"}
+else
+ {print "not ok 11\n";}
+
+$a = 2147483648;
+$b = -$a;
+$b=$b-1;
+if ($b == -(++$a))
+ {print "ok 12\n"}
+else
+ {print "not ok 12\n";}
OpenPOWER on IntegriCloud