develooper Front page | perl.perl5.porters | Postings from August 2008

t/op/int.t: test 6 failing under -Duse64bitint or -Dusemorebits

Thread Next
From:
Bram
Date:
August 10, 2008 03:08
Subject:
t/op/int.t: test 6 failing under -Duse64bitint or -Dusemorebits
Message ID:
20080810120833.uiyelj0h0ggkwsko@horde.wizbit.be
t/op/int.6 test 6 is failing for me under -Duse64bitint or -Dusemorebits
on an old machine which is installed with Debian Woody...

The test is:

{
      use integer;
      $x = length("abc") % -10;
      $y = (3/-10)*-10;
      print $x+$y == 3 && abs($x) < 10 ? "ok 6\n" : "not ok 6\n";
}

Running it with -Duse64bitint/-Dusemorebits gives:

$x = -3
$y = 0
$x + $y = -3
abs($x) = 3
not ok 6

Running it without -Duse64bitint/-Dusemorebits gives:

$x = 3
$y = 0
$x + $y = 3
abs($x) = 3
ok 6


Looking at perldoc perlop:

Note that when use integer is in scope, "%" gives you direct access to
the modulus operator as implemented by your C compiler. This operator
is not as well defined for negative operands, but it will execute
faster.


The perl was compiled with gcc 4.3.0.

I'm currently testing every gcc in the range of 4.3.0 - 3.0.0 but I  
will only have those results in 1-2 weeks.
(Each smoke takes 3 hours and 18 minutes, 74 different versions (gcc  
and g++) to test = 244 hours = 10-11 days)


Any ideas on what might be going wrong?
Or any ideas on why the tests uses a 'not as well defined operator'?


Kind regards,

Bram



Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About