/
64bit.t
69 lines (56 loc) · 1.21 KB
/
64bit.t
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!perl
# Copyright (C) 2001-2005, The Perl Foundation.
# $Id$
use strict;
use warnings;
use lib qw( . lib ../lib ../../lib );
use Test::More;
use Parrot::Test;
use Parrot::Config;
=head1 NAME
t/op/64bit.t - Testing integer ops on 64-bit platforms
=head1 SYNOPSIS
% prove t/op/64bit.t
=head1 DESCRIPTION
Test integer operations on platforms with 64-bit integers.
Tests are skipped on other platforms.
=cut
## remember to change the number of tests :-)
if ( $PConfig{intvalsize} == 8 ) {
plan tests => 1;
}
else {
plan skip_all => "64bit INTVAL platforms only";
}
pasm_output_is( <<'CODE', <<'OUTPUT', "bitops64" );
# check bitops for 8-byte ints
set I0, 0xffffffffffffffff
print I0 # -1
print "\n"
set I1, 0x00000000ffffffff
print I1 # 4294967295
print "\n"
set I0, I1
shl I0, I0, 32
print I0 # -4294967296
print "\n"
band I2, I0, I1
print I2 # 0
print "\n"
bor I2, I0, I1
print I2 # -1
print "\n"
end
CODE
-1
4294967295
-4294967296
0
-1
OUTPUT
# Local Variables:
# mode: cperl
# cperl-indent-level: 4
# fill-column: 100
# End:
# vim: expandtab shiftwidth=4: