2 eval { my $q = pack "q", 0 };
4 print "1..0\n# no 64-bit types\n";
8 unshift @INC, '../lib';
11 # This could use a lot of more tests.
13 # Nota bene: bit operations (&, |, ^, ~, <<, >>, vec) are not 64-bit clean.
14 # See the beginning of pp.c and the explanation next to IBW/UBW.
16 no warning 'overflow'; # so that using > 0xfffffff constants doesn't whine
26 $x = unpack "q", pack "q", $q;
27 print "not " unless $x == $q && $x > $f;
31 $x = sprintf("%d", 12345678901);
32 print "not " unless $x eq $q && $x > $f;
36 $x = sprintf("%d", $q);
37 print "not " unless $x == $q && $x eq $q && $x > $f;
40 $x = sprintf("%lld", $q);
41 print "not " unless $x == $q && $x eq $q && $x > $f;
44 $x = sprintf("%Ld", $q);
45 print "not " unless $x == $q && $x eq $q && $x > $f;
48 $x = sprintf("%qd", $q);
49 print "not " unless $x == $q && $x eq $q && $x > $f;
53 $x = sprintf("%x", $q);
54 print "not " unless hex($x) == 0x2dfdc1c35 && hex($x) > $f;
57 $x = sprintf("%llx", $q);
58 print "not " unless hex($x) == 0x2dfdc1c35 && hex($x) > $f;
61 $x = sprintf("%Lx", $q);
62 print "not " unless hex($x) == 0x2dfdc1c35 && hex($x) > $f;
65 $x = sprintf("%qx", $q);
66 print "not " unless hex($x) == 0x2dfdc1c35 && hex($x) > $f;
70 $x = sprintf("%o", $q);
71 print "not " unless oct("0$x") == 0133767016065 && oct($x) > $f;
74 $x = sprintf("%llo", $q);
75 print "not " unless oct("0$x") == 0133767016065 && oct($x) > $f;
78 $x = sprintf("%Lo", $q);
79 print "not " unless oct("0$x") == 0133767016065 && oct($x) > $f;
82 $x = sprintf("%qo", $q);
83 print "not " unless oct("0$x") == 0133767016065 && oct($x) > $f;
87 $x = sprintf("%b", $q);
88 print "not " unless oct("0b$x") == 0b1011011111110111000001110000110101 &&
92 $x = sprintf("%llb", $q);
93 print "not " unless oct("0b$x") == 0b1011011111110111000001110000110101 &&
97 $x = sprintf("%Lb", $q);
98 print "not " unless oct("0b$x") == 0b1011011111110111000001110000110101 &&
102 $x = sprintf("%qb", $q);
103 print "not " unless oct("0b$x") == 0b1011011111110111000001110000110101 &&
108 $x = sprintf("%u", 12345678901);
109 print "not " unless $x eq $q && $x > $f;
112 $x = sprintf("%u", $q);
113 print "not " unless $x == $q && $x eq $q && $x > $f;
116 $x = sprintf("%llu", $q);
117 print "not " unless $x == $q && $x eq $q && $x > $f;
120 $x = sprintf("%Lu", $q);
121 print "not " unless $x == $q && $x eq $q && $x > $f;
125 $x = sprintf("%D", $q);
126 print "not " unless $x == $q && $x eq $q && $x > $f;
129 $x = sprintf("%U", $q);
130 print "not " unless $x == $q && $x eq $q && $x > $f;
133 $x = sprintf("%O", $q);
134 print "not " unless oct($x) == $q && oct($x) > $f;
139 print "not " unless $x == 35802467913 && $x > $f;
143 print "not " unless $x == -11111110111 && -$x > $f;
147 print "not " unless $x == 289589985190657035812 && $x > $f;
151 print "not " unless $x == $q && $x > $f;
154 $x = 98765432109 % 12345678901;
155 print "not " unless $x == 901;