Commit | Line | Data |
760ac839 |
1 | #!./perl |
2 | |
3 | |
4 | # $RCSfile$ |
5 | |
6 | print "1..6\n"; |
7 | |
8 | # Verify that addition/subtraction properly upgrade to doubles. |
9 | # These tests are only useful on machines with 32 bit longs, |
10 | # and one's complement negation, but shouldn't fail anywhere. |
11 | |
12 | $a = 2147483647; |
13 | $a++; |
14 | if ($a == 2147483648) |
15 | {print "ok 1\n"} |
16 | else |
17 | {print "not ok 1\n";} |
18 | |
19 | $a = 2147483647; |
20 | $c=++$a; |
21 | if ($a == 2147483648) |
22 | {print "ok 2\n"} |
23 | else |
24 | {print "not ok 2\n";} |
25 | |
26 | $a = 2147483647; |
27 | $a=$a+1; |
28 | if ($a == 2147483648) |
29 | {print "ok 3\n"} |
30 | else |
31 | {print "not ok 3\n";} |
32 | |
33 | $a = -2147483648; |
34 | $c=$a--; |
35 | if ($a == -2147483649) |
36 | {print "ok 4\n"} |
37 | else |
38 | {print "not ok 4\n";} |
39 | |
40 | $a = -2147483648; |
41 | $c=--$a; |
42 | if ($a == -2147483649) |
43 | {print "ok 5\n"} |
44 | else |
45 | {print "not ok 5\n";} |
46 | |
47 | $a = -2147483648; |
48 | $a=$a-1; |
49 | if ($a == -2147483649) |
50 | {print "ok 6\n"} |
51 | else |
52 | {print "not ok 6\n";} |