This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
make hints available via globals in the respective pragmas to
[perl5.git] / t / op / inc.t
CommitLineData
760ac839
LW
1#!./perl
2
3
4# $RCSfile$
5
6print "1..6\n";
7
8# Verify that addition/subtraction properly upgrade to doubles.
1eb770ff
PP
9# These tests are only significant on machines with 32 bit longs,
10# and two's complement negation, but shouldn't fail anywhere.
760ac839
LW
11
12$a = 2147483647;
1eb770ff 13$c=$a++;
760ac839
LW
14if ($a == 2147483648)
15 {print "ok 1\n"}
16else
17 {print "not ok 1\n";}
18
19$a = 2147483647;
20$c=++$a;
21if ($a == 2147483648)
22 {print "ok 2\n"}
23else
24 {print "not ok 2\n";}
25
26$a = 2147483647;
27$a=$a+1;
28if ($a == 2147483648)
29 {print "ok 3\n"}
30else
31 {print "not ok 3\n";}
32
33$a = -2147483648;
34$c=$a--;
35if ($a == -2147483649)
36 {print "ok 4\n"}
37else
38 {print "not ok 4\n";}
39
40$a = -2147483648;
41$c=--$a;
42if ($a == -2147483649)
43 {print "ok 5\n"}
44else
45 {print "not ok 5\n";}
46
47$a = -2147483648;
48$a=$a-1;
49if ($a == -2147483649)
50 {print "ok 6\n"}
51else
52 {print "not ok 6\n";}