reported by Joseph N. Hall. The bug was that even with use64bitint
one had to use the prefixes q, L, or ll with printf/sprintf,
contrary to the documentation and common sense.
p4raw-id: //depot/cfgperl@5905
break;
}
+#ifdef USE_64_BIT_INT
+ if (!intsize)
+ intsize = 'q';
+#endif
+
/* CONVERSION */
switch (c = *q++) {
unshift @INC, '../lib';
}
-# This could use a lot of more tests.
+# This could use many more tests.
# so that using > 0xfffffff constants and
# 32+ bit integers don't cause noise
no warnings qw(overflow portable);
-print "1..48\n";
+print "1.52\n";
my $q = 12345678901;
my $r = 23456789012;
print "not " unless (0xf000000000000000 ^ 0xfffffffffffffff0) == 0x0ffffffffffffff0;
print "ok 48\n";
+
+print "not " unless (sprintf "%b", ~0) eq '1111111111111111111111111111111111111111111111111111111111111111';
+print "ok 49\n";
+
+print "not " unless (sprintf "%64b", ~0) eq '1111111111111111111111111111111111111111111111111111111111111111';
+print "ok 50\n";
+
+print "not " unless (sprintf "%d", ~0>>1) eq '9223372036854775807';
+print "ok 51\n";
+
+print "not " unless (sprintf "%u", ~0) eq '18446744073709551615';
+print "ok 52\n";
+
# eof