# New Ticket Created by Jarkko Hietaniemi
# Please include the string: [perl #30895]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org:80/rt3/Ticket/Display.html?id=30895 >
2**32 is really not *that* big, these days... (this patch obsoletes my
earlier patch for the same file from few weeks back that I cannot find
right now)
--
Jarkko Hietaniemi <[EMAIL PROTECTED]> http://www.iki.fi/jhi/ "There is this special
biologist word we use for 'stable'. It is 'dead'." -- Jack Cohen
--- t/pmc/bigint.t.dist 2004-07-31 13:02:31.000000000 +0300
+++ t/pmc/bigint.t 2004-07-31 13:32:15.000000000 +0300
@@ -121,11 +121,29 @@
999999000000
OUT
-output_is(<<'CODE', <<'OUT', "add overflow");
+use Parrot::Config;
+
+my ($a, $b, $c, $d, $e);
+if ($PConfig{intvalsize} == 8) {
+ $a = '9223372036854775806'; # 2**63-2
+ $b = '1';
+ $c = '9223372036854775807'; # still PerlInt
+ $d = '9223372036854775808'; # no more PerlInt
+ $e = '9223372036854775809'; # still no more PerlInt
+} elsif ($PConfig{intvalsize} == 4) {
+ $a = '2147483646'; # 2**31-2
+ $b = '1';
+ $c = '2147483647'; # still PerlInt
+ $d = '2147483648'; # no more PerlInt
+ $e = '2147483649'; # still no more PerlInt
+} else {
+ die "\$PConfig{intvalsize} == $PConfig{intvalsize}?\n";
+}
+output_is(<<CODE, <<OUT, "add overflow");
new P0, .PerlInt
- set P0, 2000000000
+ set P0, $a
new P1, .PerlInt
- set P1, 100000000
+ set P1, $b
new P2, .PerlInt
new P3, .BigInt
set I3, 3
@@ -136,17 +154,17 @@
print " "
typeof S1, P2
print S1
- print "\n"
- add P1, 100000000
+ print "\\n"
+ add P1, $b
dec I3
if I3, lp
- print "ok\n"
+ print "ok\\n"
ex:
end
CODE
-2100000000 PerlInt
-2200000000 BigInt
-2300000000 BigInt
+$c PerlInt
+$d BigInt
+$e BigInt
ok
OUT