Index: t/steps/auto_jit-01.t =================================================================== --- t/steps/auto_jit-01.t (revision 37217) +++ t/steps/auto_jit-01.t (working copy) @@ -5,7 +5,7 @@ use strict; use warnings; -use Test::More tests => 50; +use Test::More tests => 51; use Carp; use Cwd; use File::Path qw( mkpath ); @@ -52,7 +52,7 @@ my $corejitdir = File::Spec->catdir ( $jitbase, $cpuarch ); mkpath( $corejitdir, 0, 755 ) or croak "Unable to make testing directory"; my $corejit = File::Spec->catfile( $jitbase, $cpuarch, q{core.jit} ); - is( $step->_check_jitcapability($corejit, $cpuarch, $osname), 0, + is( $step->_check_jitcapability($corejit, $cpuarch, $osname, 8), 0, "Got expected value for _check_jitcapability(): no core.jit case"); chdir $cwd or croak "Unable to change back to starting directory"; @@ -71,7 +71,7 @@ or croak "Unable to open handle to file for testing"; print $FH qq{Hello, JIT\n}; close $FH or croak "Unable to close handle to file for testing"; - is( $step->_check_jitcapability($corejit, $cpuarch, $osname), 0, + is( $step->_check_jitcapability($corejit, $cpuarch, $osname, 8), 0, "Got expected value for _check_jitcapability(): no JIT on this architecture case"); chdir $cwd or croak "Unable to change back to starting directory"; @@ -92,7 +92,7 @@ close $FH or croak "Unable to close handle to file for testing"; my $orig = $step->{jit_is_working}; $step->{jit_is_working} = { $cpuarch => 1 }; - is( $step->_check_jitcapability($corejit, $cpuarch, $osname), 1, + is( $step->_check_jitcapability($corejit, $cpuarch, $osname, 8), 1, "Got expected value for _check_jitcapability(): mock JIT case"); $step->{jit_is_working} = $orig; @@ -114,13 +114,35 @@ close $FH or croak "Unable to close handle to file for testing"; my $orig = $step->{jit_is_working}; $step->{jit_is_working} = { $cpuarch => 1 }; - is( $step->_check_jitcapability($corejit, $cpuarch, $osname), 0, + is( $step->_check_jitcapability($corejit, $cpuarch, $osname, 8), 0, "Got expected value for _check_jitcapability(): mock darwin-i386 case"); $step->{jit_is_working} = $orig; chdir $cwd or croak "Unable to change back to starting directory"; } +{ + my $tdir = tempdir( CLEANUP => 1 ); + chdir $tdir or croak "Unable to change to temporary directory"; + my $jitbase = 'foo'; + my $cpuarch = 'i386'; + my $osname = 'MSWin32'; + my $corejitdir = File::Spec->catdir ( $jitbase, $cpuarch ); + mkpath( $corejitdir, 0, 755 ) or croak "Unable to make testing directory"; + my $corejit = File::Spec->catfile( $jitbase, $cpuarch, q{core.jit} ); + open my $FH, '>', $corejit + or croak "Unable to open handle to file for testing"; + print $FH qq{Hello, JIT\n}; + close $FH or croak "Unable to close handle to file for testing"; + my $orig = $step->{jit_is_working}; + $step->{jit_is_working} = { $cpuarch => 1 }; + is( $step->_check_jitcapability($corejit, $cpuarch, $osname, 4), 0, + "Got expected value for _check_jitcapability(): mock single-float"); + $step->{jit_is_working} = $orig; + + chdir $cwd or croak "Unable to change back to starting directory"; +} + ########### _handle_asm() ########### { Index: config/auto/jit.pm =================================================================== --- config/auto/jit.pm (revision 37217) +++ config/auto/jit.pm (working copy) @@ -53,6 +53,7 @@ my $cpuarch = $conf->data->get('cpuarch'); my $osname = $conf->data->get('osname'); + my $nvsize = $conf->data->get('nvsize'); my $jitbase = $self->{jitbase_default}; # base path for jit sources @@ -62,7 +63,7 @@ if $verbose; my $jitcapable = - $self->_check_jitcapability($corejit, $cpuarch, $osname); + $self->_check_jitcapability($corejit, $cpuarch, $osname, $nvsize); my $jitarchname = "$cpuarch-$osname"; _handle_asm( { @@ -148,7 +149,7 @@ sub _check_jitcapability { my $self = shift; - my ($corejit, $cpuarch, $osname) = @_; + my ($corejit, $cpuarch, $osname, $nvsize) = @_; my $jitcapable = 0; if ( -e $corejit ) { @@ -162,6 +163,12 @@ $jitcapable = 1; } + # Can only jit double. For long double see patch in TT #352. + # float not yet planned. + if ( $nvsize != 8 ) { + $jitcapable = 0; + } + # Another exception if ( $cpuarch eq 'i386' && $osname eq 'darwin' ) { $jitcapable = 0;