From: Jarkko Hietaniemi Date: Tue, 9 May 2000 15:35:34 +0000 (+0000) Subject: Hints and test tweaks for Unicos. X-Git-Tag: accepted/trunk/20130322.191538~34817^2~35 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f3ff050fccffadeeccf49f587e2b99d7f1c70fd6;p=platform%2Fupstream%2Fperl.git Hints and test tweaks for Unicos. p4raw-id: //depot/cfgperl@6101 --- diff --git a/hints/unicos.sh b/hints/unicos.sh index 33974f2..e49b373 100644 --- a/hints/unicos.sh +++ b/hints/unicos.sh @@ -6,9 +6,11 @@ case "$optimize" in # --Mark P. Lutz '') optimize="$optimize -h nofastmd" ;; esac -# The default is to die on math overflows with an runtime error. +# The default is to die in runtime on math overflows. # Let's not do that. --jhi ccflags="$ccflags -h matherror=errno" +# Give int((2/3)*3) a chance to be 2, not 1. --jhi +ccflags="$ccflags -h rounddiv" # Avoid an optimizer bug where a volatile variables # isn't correctly saved and restored --Mark P. Lutz pp_ctl_cflags='ccflags="$ccflags -h scalar0 -h vector0"' diff --git a/t/lib/b.t b/t/lib/b.t index 663ea55..9e468f7 100755 --- a/t/lib/b.t +++ b/t/lib/b.t @@ -83,10 +83,14 @@ ok; chomp($a = `$^X -I../lib -MB::Stash -Mwarnings -e1`); $a = join ',', sort split /,/, $a; $a =~ s/-uWin32,//; -$b = '-uCarp,-uCarp::Heavy,-uDB,-uExporter,-uExporter::Heavy,-uattributes,' - . '-umain,-uwarnings'; -print "# [$a] vs [$b]\nnot " if $a ne $b; -ok; +if ($Config{static_ext} eq ' ') { + $b = '-uCarp,-uCarp::Heavy,-uDB,-uExporter,-uExporter::Heavy,-uattributes,' + . '-umain,-uwarnings'; + print "# [$a] vs [$b]\nnot " if $a ne $b; + ok; +} else { + print "ok $test # skipped: one or more static extensions\n"; $test++; +} $a = `$^X -I../lib -MO=Showlex -e "my %one" 2>&1`; print "# [$a]\nnot " unless $a =~ /sv_undef.*PVNV.*%one.*sv_undef.*HV/s; diff --git a/t/lib/complex.t b/t/lib/complex.t index d4beb8b..4fc6737 100755 --- a/t/lib/complex.t +++ b/t/lib/complex.t @@ -27,7 +27,7 @@ my @script = ( my $eps = 1e-13; if ($^O eq 'unicos') { # For some reason root() produces very inaccurate - $eps = 1e-11; # results in Cray UNICOS, and occasionally also + $eps = 1e-10; # results in Cray UNICOS, and occasionally also } # cos(), sin(), cosh(), sinh(). The division # of doubles is the current suspect. @@ -262,7 +262,7 @@ EOS $test++; push @script, <display_format('style' => 'polar', 'polar_pretty_print' => 0); diff --git a/t/op/64bitint.t b/t/op/64bitint.t index f59c953..ac37716 100644 --- a/t/op/64bitint.t +++ b/t/op/64bitint.t @@ -123,9 +123,17 @@ $x = $q - $r; print "not " unless $x == -11111110111 && -$x > $f; print "ok 22\n"; -$x = $q * 1234567; -print "not " unless $x == 15241567763770867 && $x > $f; -print "ok 23\n"; +if ($^O ne 'unicos') { + $x = $q * 1234567; + print "not " unless $x == 15241567763770867 && $x > $f; + print "ok 23\n"; +} else { + # Unicos has imprecise doubles (14 decimal digits or so), + # the multiplication mangles the low-order bits. + $x = $q * 1234; + print "not " unless $x == 15234567763834 && $x > $f; + print "ok 23\n"; +} $x /= 1234567; print "not " unless $x == $q && $x > $f; @@ -137,71 +145,92 @@ print "ok 25\n"; # The following 12 tests adapted from op/inc. -$a = 9223372036854775807; -$c = $a++; -print "not " unless $a == 9223372036854775808; -print "ok 26\n"; - -$a = 9223372036854775807; -$c = ++$a; -print "not " unless $a == 9223372036854775808 && $c == $a; -print "ok 27\n"; - -$a = 9223372036854775807; -$c = $a + 1; -print "not " unless $a == 9223372036854775807 && $c == 9223372036854775808; -print "ok 28\n"; - -$a = -9223372036854775808; -$c = $a--; -print "not " unless $a == -9223372036854775809 && $c == -9223372036854775808; -print "ok 29\n"; - -$a = -9223372036854775808; -$c = --$a; -print "not " unless $a == -9223372036854775809 && $c == $a; -print "ok 30\n"; - -$a = -9223372036854775808; -$c = $a - 1; -print "not " unless $a == -9223372036854775808 && $c == -9223372036854775809; -print "ok 31\n"; - -$a = 9223372036854775808; -$a = -$a; -$c = $a--; -print "not " unless $a == -9223372036854775809 && $c == -9223372036854775808; -print "ok 32\n"; - -$a = 9223372036854775808; -$a = -$a; -$c = --$a; -print "not " unless $a == -9223372036854775809 && $c == $a; -print "ok 33\n"; - -$a = 9223372036854775808; -$a = -$a; -$c = $a - 1; -print "not " unless $a == -9223372036854775808 && $c == -9223372036854775809; -print "ok 34\n"; - -$a = 9223372036854775808; -$b = -$a; -$c = $b--; -print "not " unless $b == -$a-1 && $c == -$a; -print "ok 35\n"; - -$a = 9223372036854775808; -$b = -$a; -$c = --$b; -print "not " unless $b == -$a-1 && $c == $b; -print "ok 36\n"; - -$a = 9223372036854775808; -$b = -$a; -$b = $b - 1; -print "not " unless $b == -(++$a); -print "ok 37\n"; +if ($^O ne 'unicos') { + $a = 9223372036854775807; + $c = $a++; + print "not " unless $a == 9223372036854775808; + print "ok 26\n"; + + $a = 9223372036854775807; + $c = ++$a; + print "not " + unless $a == 9223372036854775808 && $c == $a; + print "ok 27\n"; + + $a = 9223372036854775807; + $c = $a + 1; + print "not " + unless $a == 9223372036854775807 && $c == 9223372036854775808; + print "ok 28\n"; + + $a = -9223372036854775808; + $c = $a--; + print "not " + unless $a == -9223372036854775809 && $c == -9223372036854775808; + print "ok 29\n"; + + $a = -9223372036854775808; + $c = --$a; + print "not " + unless $a == -9223372036854775809 && $c == $a; + print "ok 30\n"; + + $a = -9223372036854775808; + $c = $a - 1; + print "not " + unless $a == -9223372036854775808 && $c == -9223372036854775809; + print "ok 31\n"; + + $a = 9223372036854775808; + $a = -$a; + $c = $a--; + print "not " + unless $a == -9223372036854775809 && $c == -9223372036854775808; + print "ok 32\n"; + + $a = 9223372036854775808; + $a = -$a; + $c = --$a; + print "not " + unless $a == -9223372036854775809 && $c == $a; + print "ok 33\n"; + + $a = 9223372036854775808; + $a = -$a; + $c = $a - 1; + print "not " + unless $a == -9223372036854775808 && $c == -9223372036854775809; + print "ok 34\n"; + + $a = 9223372036854775808; + $b = -$a; + $c = $b--; + print "not " + unless $b == -$a-1 && $c == -$a; + print "ok 35\n"; + + $a = 9223372036854775808; + $b = -$a; + $c = --$b; + print "not " + unless $b == -$a-1 && $c == $b; + print "ok 36\n"; + + $a = 9223372036854775808; + $b = -$a; + $b = $b - 1; + print "not " + unless $b == -(++$a); + print "ok 37\n"; + +} else { + # Unicos has imprecise doubles (14 decimal digits or so), + # near the UV/IV limites the low-order bits become mangled + # even by simple additions and subtractions. + for (26..37) { + print "ok #_ # skipped: too imprecise numbers\n"; + } +} $x = ''; @@ -233,17 +262,23 @@ print "ok 45\n"; print "not " unless (0x8000000000000000 | 1) == 0x8000000000000001; print "ok 46\n"; -print "not " unless (0xf000000000000000 & 0x8000000000000000) == 0x8000000000000000; +print "not " + unless (0xf000000000000000 & 0x8000000000000000) == 0x8000000000000000; print "ok 47\n"; -print "not " unless (0xf000000000000000 ^ 0xfffffffffffffff0) == 0x0ffffffffffffff0; +print "not " + unless (0xf000000000000000 ^ 0xfffffffffffffff0) == 0x0ffffffffffffff0; print "ok 48\n"; -print "not " unless (sprintf "%b", ~0) eq '1111111111111111111111111111111111111111111111111111111111111111'; +print "not " + unless (sprintf "%b", ~0) eq + '1111111111111111111111111111111111111111111111111111111111111111'; print "ok 49\n"; -print "not " unless (sprintf "%64b", ~0) eq '1111111111111111111111111111111111111111111111111111111111111111'; +print "not " + unless (sprintf "%64b", ~0) eq + '1111111111111111111111111111111111111111111111111111111111111111'; print "ok 50\n"; print "not " unless (sprintf "%d", ~0>>1) eq '9223372036854775807';