$expect = 7 * ($#FOO+2) * ($#FOO+1) + 6 * @raw + 6 * @utf8;
print "1..$expect\n";
+my $bad_NaN = 0;
+
+{
+ # gcc's -ffast-math option may stop NaNs working correctly
+ use Config;
+ my $ccflags = $Config{ccflags} // '';
+ $bad_NaN = 1 if $ccflags =~ /-ffast-math\b/;
+}
+
sub nok ($$$$$$$$) {
my ($test, $left, $threeway, $right, $result, $i, $j, $boolean) = @_;
$result = defined $result ? "'$result'" : 'undef';
- print "not ok $test # ($left $threeway $right) gives: $result \$i=$i \$j=$j, $boolean disagrees\n";
+ if ($bad_NaN && ($left eq 'NaN' || $right eq 'NaN')) {
+ print "ok $test # skipping failed NaN test under -ffast-math\n";
+ }
+ else {
+ print "not ok $test # ($left $threeway $right) gives: $result \$i=$i \$j=$j, $boolean disagrees\n";
+ }
}
my $ok = 0;