Index: parrot-svn/lib/Parrot/BuildUtil.pm =================================================================== --- parrot-svn.orig/lib/Parrot/BuildUtil.pm 2009-02-28 01:01:45.296875000 +0100 +++ parrot-svn/lib/Parrot/BuildUtil.pm 2009-02-28 10:22:34.046875000 +0100 @@ -12,9 +12,9 @@ =head1 DESCRIPTION -This package holds three subroutines: C, C, -and C. Subroutines are not exported--each must be -requested by using a fully qualified name. +This package holds pre-configure time subroutines, which are not exported +and should not require Parrot::Config. +Each must be requested by using a fully qualified name. =head1 SUBROUTINES @@ -134,13 +134,35 @@ return $header; } -1; +=item C -=back +Return an array of ($bc_major, $bc_minor) from F. +This is used in the native_pbc tests. + +See also F and F. -=head1 AUTHOR +=cut -Gregor N. Purdy. Revised by James E Keenan. +sub get_bc_version { + my $compat_file = 'PBC_COMPAT'; + my ( $bc_major, $bc_minor ); + open my $IN, '<', $compat_file or die "Can't read $compat_file"; + while (<$IN>) { + if (/^(\d+)\.0*(\d+)/) { + ( $bc_major, $bc_minor ) = ( $1, $2 ); + last; + } + } + unless ( defined $bc_major && defined $bc_minor ) { + die "No bytecode version found in '$compat_file'."; + } + close $IN; + return ( $bc_major, $bc_minor ); +} + +1; + +=back =cut Index: parrot-svn/tools/build/pbcversion_h.pl =================================================================== --- parrot-svn.orig/tools/build/pbcversion_h.pl 2009-02-28 01:01:45.374875000 +0100 +++ parrot-svn/tools/build/pbcversion_h.pl 2009-02-28 10:22:34.062500000 +0100 @@ -21,28 +21,19 @@ use warnings; use strict; use lib 'lib'; +use Parrot::BuildUtil; -my ( $major, $minor ); - -my $compat_file = 'PBC_COMPAT'; -open my $IN, '<', $compat_file or die "Can't read $compat_file"; -while (<$IN>) { - if (/^(\d+)\.0*(\d+)/) { - ( $major, $minor ) = ( $1, $2 ); - last; - } -} -close $IN; +my ( $major, $minor ) = Parrot::BuildUtil::get_bc_version(); unless ( defined $major && defined $minor ) { - die "No bytecode version found in '$compat_file'."; + die "No bytecode version found in 'PBC_COMPAT'."; } print << "EOF"; /* ex: set ro: * !!!!!!! DO NOT EDIT THIS FILE !!!!!!! * - * This file is generated automatically from '$compat_file' + * This file is generated automatically from 'PBC_COMPAT' * by $0. * * Any changes made here will be lost! Index: parrot-svn/t/native_pbc/integer.t =================================================================== --- parrot-svn.orig/t/native_pbc/integer.t 2009-02-28 01:01:45.311875000 +0100 +++ parrot-svn/t/native_pbc/integer.t 2009-02-28 11:13:20.328125000 +0100 @@ -7,8 +7,9 @@ use lib qw( . lib ../lib ../../lib ); use Test::More; use Parrot::Config; +use Parrot::BuildUtil; -use Parrot::Test tests => 5; +use Parrot::Test tests => 7; =head1 NAME @@ -22,30 +23,32 @@ Tests word-size/float-type/endian-ness for different architectures. -These tests usually only work on releases, not on svn checkouts -and if every release has updated native pbc test files. - -See F to create the platform-specific native pbcs. +These tests usually only work on updated native pbc test files. +See F to create the platform-specific +native pbcs. =head1 PLATFORMS - _1 i386 32 bit opcode_t, 32 bit intval - (linux-gcc-ix86, freebsd-gcc, cygwin) + _1 i386 32 bit opcode_t, 32 bit intval, 8 byte double + (linux-gcc-i386, freebsd-gcc, cygwin, ...) - _2 i386 32 bit opcode_t, 32 bit intval, 12 bit long double - (linux-gcc-ix86) + _2 i386 32 bit opcode_t, 32 bit intval, 12 byte long double + (linux-gcc-i386 or cygwin with --floatval="long double") - _3 PPC BE 32 bit opcode_t, 32 bit intval + _3 PPC BE 32 bit opcode_t, 32 bit intval, 8 byte double (darwin-ppc) - _4 x86_64 12-bit double 64 bit opcode_t - (linux-gcc-x86_64 -m96bit-long-double) + _4 x86_64 64 bit opcode_t, 64 bit intval, 8 byte double + (linux-gcc-x86_64 resp. amd64, solaris-cc-64int) + + _5 x86_64 64 bit opcode_t, 64 bit intval, 16 byte long double + (linux-gcc-x86_64, solaris-cc-64int --floatval="long double") - _5 x86_64 16 bit long double 64 bit opcode_t - (linux-gcc-x86_64, solaris-cc-64int) + _6 big-endian 64 bit opcode_t, 64 bit intval, 8 byte double + (Sparc64/Solaris, MIPS irix or similar) - _6 big-endian 64-bit - (MIPS irix or similar) + _7 big-endian 64 bit opcode_t, 64 bit intval, 16 byte long double + (Sparc64/Solaris --floatval="long double") =cut @@ -77,6 +80,69 @@ =cut +my @archtest = qw(4_le 4_le 4_be 4_le 8_le 8_be 8_be); +sub this_arch { + return $PConfig{intvalsize} + . "_" + . (substr($PConfig{byteorder},0,2) eq '12' ? "le" : "be"); +} + +sub bc_version($) { + my $f = shift; + my $b; + open my $F, "<", "$f" or return "Can't open $f: $!"; + binmode $F; + seek $F, 14, 0; + read $F, $b, 8; + my ($bc_major, $bc_minor) = unpack "cc", $b; + return ($bc_major . "." . $bc_minor); +} +my ( $bc_major, $bc_minor ) = Parrot::BuildUtil::get_bc_version(); +my $bc = ($bc_major . "." . $bc_minor); +my $arch = this_arch(); +# all should pass +my $todo = {}; +my $skip = {}; + +# expected result +my $output = '270544960'; + +# test_pbc_integer(1, "i386 8-byte double float, 32 bit opcode_t"); +sub test_pbc_integer { + my $id = shift; + my $desc = shift; + my $file = "t/native_pbc/integer_$id.pbc"; + my $cvt = "$archtest[$id-1]=>$arch"; + my $skip_msg; + # check if this a platform where we can produce the needed file + if ($archtest[$id-1] eq $arch) { + $skip_msg = "Want to help? Regenerate $file " + . "with tools/dev/mk_native_pbc --noconf"; + } + else { + $skip_msg = "$file is outdated. " + . "Need $archtest[$id-1] platform."; + } + # check if skip or todo + SKIP: { + if ( $skip->{$id} ) { + skip "$cvt not yet implemented", 1 + } + elsif ( $todo->{$id} ) { + skip $skip_msg, 1 + if ($bc ne bc_version($file)); + pbc_output_is( undef, $output, "$cvt $desc", + todo => "$cvt yet untested, TT #357. " + . "Please report success." ); + } + else { + skip $skip_msg, 1 + if ($bc ne bc_version($file)); + pbc_output_is( undef, $output, "$cvt $desc" ); + } + } +} + # execute the file t/native_pbc/integer_1.pbc # # any ordinary intel 386 linux, cygwin, mingw, MSWin32, ... @@ -84,34 +150,24 @@ # wordsize = 4 (interpreter's wordsize/INTVAL = 4/4) # byteorder = 0 (interpreter's byteorder = 0) # floattype = 0 (interpreter's NUMVAL_SIZE = 8) -# parrot-version 0.9.0, bytecode-version 3.34 +# parrot-version 0.9.1, bytecode-version 3.36 # UUID type = 0, UUID size = 0 # no endianize, no opcode, no numval transform # dirformat = 1 # ] -TODO: { - local $TODO; - if ($PConfig{ptrsize} == 8) { - $TODO = "Known problem on 64bit with reading 32bit dirs. See TT #254" - } elsif ($PConfig{DEVEL}) { - $TODO = "devel versions are not guaranteed to succeed"; - } +test_pbc_integer(1, "i386 8-byte double float, 32 bit opcode_t, 4-byte int"); -pbc_output_is( undef, '270544960', "i386 32 bit opcode_t, 32 bit intval" ) - or diag "May need to regenerate t/native_pbc/integer_1.pbc; read test file"; - -# adding --floatval='long double' +# adding --floatval="long double" --jitcapable=0 # HEADER => [ # wordsize = 4 (interpreter's wordsize/INTVAL = 4/4) # byteorder = 0 (interpreter's byteorder = 0) # floattype = 1 (interpreter's NUMVAL_SIZE = 12) -# parrot-version 0.9.0, bytecode-version 3.34 +# parrot-version 0.9.1, bytecode-version 3.36 # UUID type = 0, UUID size = 0 # no endianize, no opcode, no numval transform # dirformat = 1 # ] -pbc_output_is( undef, '270544960', "i386 32 bit opcode_t, 32 bit intval 12-byte long double" ) - or diag "May need to regenerate t/native_pbc/integer_2.pbc; read test file"; +test_pbc_integer(2, "i386 12-byte double float, 32 bit opcode_t, 4-byte int"); # darwin/ppc: # HEADER => [ @@ -123,36 +179,21 @@ # no endianize, no opcode, no numval transform # dirformat = 1 # ] - -pbc_output_is(undef, '270544960', "PPC BE 32 bit opcode_t, 32 bit intval") - or diag "May need to regenerate t/native_pbc/integer_3.pbc; read test file"; - -} - -TODO: { - local $TODO; - if ($PConfig{ptrsize} == 4) { - $TODO = "Known problem on 32bit with reading 64bit dirs. See TT #254" - # Unknown PMC type to thaw 0 - } elsif ($PConfig{DEVEL}) { - $TODO = "devel versions are not guaranteed to succeed"; - } +test_pbc_integer(3, "PPC BE 32 bit opcode_t, 4-byte int"); # any ordinary 64-bit intel unix: # HEADER => [ # wordsize = 8 (interpreter's wordsize/INTVAL = 8/8) # byteorder = 0 (interpreter's byteorder = 0) # floattype = 0 (interpreter's NUMVAL_SIZE = 8) -# parrot-version 0.9.0, bytecode-version 3.34 +# parrot-version 0.9.1, bytecode-version 3.36 # UUID type = 0, UUID size = 0 # no endianize, no opcode, no numval transform # dirformat = 1 # ] +test_pbc_integer(4, "i86_64 LE 64 bit opcode_t, 8-byte int, 8-byte double"); -pbc_output_is(undef, '270544960', "i86_64 LE 64 bit opcode_t, 64 bit intval") - or diag "May need to regenerate t/native_pbc/integer_4.pbc; read test file"; - -# adding --floatval='long double' +# adding --floatval="long double" # HEADER => [ # wordsize = 8 (interpreter's wordsize/INTVAL = 8/8) # byteorder = 0 (interpreter's byteorder = 0) @@ -162,15 +203,22 @@ # no endianize, no opcode, no numval transform # dirformat = 1 # ] +test_pbc_integer(5, "i86_64 LE 64 bit opcode_t, 8-byte int, 16-byte double"); -pbc_output_is(undef, '270544960', "i86_64 LE 64 bit opcode_t, 64 bit intval, 16-byte long double") - or diag "May need to regenerate t/native_pbc/integer_5.pbc; read test file"; - -# Formerly following tests had been set up: -# pbc_output_is(undef, '270544960', "big-endian 64-bit (irix)"); -# or diag "May need to regenerate t/native_pbc/integer_6.pbc; read test file"; +# ppc/mips -m64 +# HEADER => [ +# wordsize = 8 (interpreter's wordsize/INTVAL = 8/8) +# byteorder = 1 (interpreter's byteorder = 0) +# floattype = 0 (interpreter's NUMVAL_SIZE = 8) +# parrot-version 0.9.1, bytecode-version 3.35 +# UUID type = 0, UUID size = 0 +# *need* endianize, no opcode, no numval transform +# dirformat = 1 +# ] +test_pbc_integer(6, "big-endian 64-bit, 8-byte int, 8-byte double"); -} +# ppc/mips -m64 --floatval="long double" +test_pbc_integer(7, "big-endian 64-bit, 8-byte int, 16-byte double"); # Local Variables: # mode: cperl Index: parrot-svn/t/native_pbc/number.t =================================================================== --- parrot-svn.orig/t/native_pbc/number.t 2009-02-28 01:01:45.327875000 +0100 +++ parrot-svn/t/native_pbc/number.t 2009-02-28 10:59:27.718750000 +0100 @@ -7,8 +7,9 @@ use lib qw( . lib ../lib ../../lib ); use Test::More; use Parrot::Config; +use Parrot::BuildUtil; -use Parrot::Test tests => 5; +use Parrot::Test tests => 7; =head1 NAME @@ -22,22 +23,47 @@ Tests word-size/float-type/endian-ness for different architectures. -These tests usually only work on releases, not on svn checkouts -and if every release has updated native pbc test files. - -See F to create the platform-specific native pbcs. +These tests usually only work on updated native pbc test files. +See F to create the platform-specific +native pbcs. =head1 PLATFORMS - _1 i386 32 bit opcode_t, 32 bit intval (linux-gcc-ix86, freebsd-gcc, cygwin) - _2 i386 32 bit opcode_t, 32 bit intval, 12 bit long double (linux-gcc-ix86) - _3 PPC BE 32 bit opcode_t, 32 bit intval (darwin-ppc) - _4 x86_64 12-bit double 64 bit opcode_t (linux-gcc-x86_64 -m96bit-long-double) - _5 x86_64 16 bit long double 64 bit opcode_t (linux-gcc-x86_64, solaris-cc-64int) - _6 big-endian 64-bit (MIPS irix or similar) + _1 i386 32 bit opcode_t, 32 bit intval, 8 byte double + (linux-gcc-i386, freebsd-gcc, cygwin, ...) + + _2 i386 32 bit opcode_t, 32 bit intval, 12 byte long double + (linux-gcc-i386 or cygwin with --floatval="long double") + + _3 PPC BE 32 bit opcode_t, 32 bit intval, 8 byte double + (darwin-ppc) + + _4 x86_64 64 bit opcode_t, 64 bit intval, 8 byte double + (linux-gcc-x86_64 resp. amd64, solaris-cc-64int) + + _5 x86_64 64 bit opcode_t, 64 bit intval, 16 byte long double + (linux-gcc-x86_64, solaris-cc-64int --floatval="long double") + + _6 big-endian 64 bit opcode_t, 64 bit intval, 8 byte double + (Sparc64/Solaris, MIPS irix or similar) + + _7 big-endian 64 bit opcode_t, 64 bit intval, 16 byte long double + (Sparc64/Solaris --floatval="long double") =cut +# tt #357: need better testmatrix for coverage overview +# float conversion src: left-side (pbc) to dest: upper-side (platform) +# 1: tested ok, 0: fails (skip), ?: not yet tested (todo) +my $testmatrix = < [1,4], '12_le' => [2], '16_le' => [5], + '8_be' => [3,6], '16_be' => [7] }; +# the reverse: which tests for which arch +my @archtest = qw(8_le 12_le 8_be 8_le 16_le 8_be 16_be); +# @todo lists of tests for your architecture. +# e.g. for arch 8_le => tests (8_be) => todo (3 6) +sub generate_skip_list { + my $arch = shift; + my $check = shift; + my %skip; + my @lines = split /\n/, $testmatrix; + my @dest = split /\s+/, shift @lines; + shift @dest unless $dest[0]; + my $i = 0; + my %cols = map { $_ => $i++ } @dest; + my $col = $cols{$arch}; # the column for our arch + for my $s (@lines) { + my @s = split /\s+/, $s; + my $pbc = shift @s; + if ($s[$col] eq $check) { + for (@{$destarch->{$pbc}}) { $skip{$_}++ } + } + } + \%skip +} +# 16_le +sub this_arch { + return $PConfig{numvalsize} + . "_" + . (substr($PConfig{byteorder},0,2) eq '12' ? "le" : "be"); +} + +sub bc_version($) { + my $f = shift; + my $b; + open my $F, "<", "$f" or return "Can't open $f: $!"; + binmode $F; + seek $F, 14, 0; + read $F, $b, 8; + my ($bc_major, $bc_minor) = unpack "cc", $b; + return ($bc_major . "." . $bc_minor); +} +my ( $bc_major, $bc_minor ) = Parrot::BuildUtil::get_bc_version(); +my $bc = ($bc_major . "." . $bc_minor); +my $arch = this_arch(); +my $todo = generate_skip_list($arch, '?'); +my $skip = generate_skip_list($arch, '0'); + my $output = << 'END_OUTPUT'; 1 4 @@ -94,40 +174,65 @@ 1.12589990684262e+15 END_OUTPUT -# execute t/native_pbc/number_1.pbc +# test_pbc_number(1, "i386 8-byte double float, 32 bit opcode_t"); +sub test_pbc_number { + my $id = shift; + my $desc = shift; + my $cvt = "$archtest[$id-1]=>$arch"; + my $skip_msg; + # check if this a platform where we can produce the needed file + if ($archtest[$id-1] eq $arch) { + $skip_msg = "Want to help? Regenerate t/native_pbc/number_$id.pbc " + . "with tools/dev/mk_native_pbc --noconf"; + } + else { + $skip_msg = "t/native_pbc/number_$id.pbc is outdated. " + . "Need $archtest[$id-1] platform."; + } + # check if skip or todo + SKIP: { + if ( $skip->{$id} ) { + skip "$cvt not yet implemented", 1 + } + elsif ( $todo->{$id} ) { + skip $skip_msg, 1 + if ($bc ne bc_version("t/native_pbc/number_$id.pbc")); + pbc_output_is( undef, $output, "$cvt $desc", + todo => "$cvt yet untested, TT #357. " + . "Please report success." ); + } + else { + skip $skip_msg, 1 + if ($bc ne bc_version("t/native_pbc/number_$id.pbc")); + pbc_output_is( undef, $output, "$cvt $desc" ); + } + } +} + +# execute t/native_pbc/number_*.pbc # # any ordinary intel 386 linux, cygwin, mingw, MSWin32, ... # HEADER => [ # wordsize = 4 (interpreter's wordsize/INTVAL = 4/4) # byteorder = 0 (interpreter's byteorder = 0) # floattype = 0 (interpreter's NUMVAL_SIZE = 8) -# parrot-version 0.9.0, bytecode-version 3.34 +# parrot-version 0.9.1, bytecode-version 3.36 # UUID type = 0, UUID size = 0 # no endianize, no opcode, no numval transform # dirformat = 1 # ] -TODO: { - local $TODO; - if ($PConfig{ptrsize} == 8) { - $TODO = "Known problem on 64bit with reading 32bit dirs. See TT #254" - } elsif ($PConfig{DEVEL}) { - $TODO = "devel versions are not guaranteed to succeed"; - } - -pbc_output_is( undef, $output, "i386 double float 32 bit opcode_t" ) - or diag "May need to regenerate t/native_pbc/number_1.pbc; read test file"; +test_pbc_number(1, "i386 8-byte double float, 32 bit opcode_t"); # HEADER => [ # wordsize = 4 (interpreter's wordsize/INTVAL = 4/4) # byteorder = 0 (interpreter's byteorder = 0) # floattype = 1 (interpreter's NUMVAL_SIZE = 12) -# parrot-version 0.9.0, bytecode-version 3.34 +# parrot-version 0.9.1, bytecode-version 3.36 # UUID type = 0, UUID size = 0 # no endianize, no opcode, no numval transform # dirformat = 1 # ] -pbc_output_is( undef, $output, "i386 long double float 32 bit opcode_t") - or diag "May need to regenerate t/native_pbc/number_2.pbc; read test file"; +test_pbc_number(2, "i386 12-byte long double float, 32 bit opcode_t"); # darwin/ppc: # HEADER => [ @@ -139,34 +244,21 @@ # no endianize, no opcode, no numval transform # dirformat = 1 # ] - -pbc_output_is(undef, $output, "PPC double float 32 bit BE opcode_t") - or diag "May need to regenerate t/native_pbc/number_3.pbc; read test file"; -} - -TODO: { - local $TODO; - if ($PConfig{ptrsize} == 4) { - $TODO = "Known problem on 32bit with reading 64bit dirs. See TT #254" - # Unknown PMC type to thaw 0 - } elsif ($PConfig{DEVEL}) { - $TODO = "devel versions are not guaranteed to succeed"; - } +test_pbc_number(3, "PPC double float 32 bit BE opcode_t"); # any ordinary 64-bit intel unix: # HEADER => [ # wordsize = 8 (interpreter's wordsize/INTVAL = 8/8) # byteorder = 0 (interpreter's byteorder = 0) # floattype = 0 (interpreter's NUMVAL_SIZE = 8) -# parrot-version 0.9.0, bytecode-version 3.34 +# parrot-version 0.9.1, bytecode-version 3.36 # UUID type = 0, UUID size = 0 # no endianize, no opcode, no numval transform # dirformat = 1 # ] +test_pbc_number(4, "i86_64 LE 64 bit opcode_t, 8-byte double"); -pbc_output_is(undef, $output, "i86_64 LE 64 bit opcode_t, 64 bit intval") - or diag "May need to regenerate t/native_pbc/number_4.pbc; read test file"; - +# i86_64 with floatval='long double' # HEADER => [ # wordsize = 8 (interpreter's wordsize/INTVAL = 8/8) # byteorder = 0 (interpreter's byteorder = 0) @@ -176,14 +268,22 @@ # no endianize, no opcode, no numval transform # dirformat = 1 # ] -pbc_output_is(undef, $output, "i86_64 LE 64 bit opcode_t, 64 bit intval, long double") - or diag "May need to regenerate t/native_pbc/integer_5.pbc; read test file"; +test_pbc_number(5, "i86_64 LE 64 bit opcode_t, long double"); -# Formerly there were also a test for: -# pbc_output_is(undef, $output, "big-endian 64-bit irix") -# or diag "May need to regenerate t/native_pbc/number_6.pbc; read test file"; +# PowerPC64 -m64 +# HEADER => [ +# wordsize = 8 (interpreter's wordsize/INTVAL = 8/8) +# byteorder = 1 (interpreter's byteorder = 0) +# floattype = 0 (interpreter's NUMVAL_SIZE = 8) +# parrot-version 0.9.1, bytecode-version 3.35 +# UUID type = 0, UUID size = 0 +# *need* endianize, no opcode, no numval transform +# dirformat = 1 +# ] +test_pbc_number(6, "big-endian 64-bit, 8-byte double"); -} +# PowerPC64 --floatval="long double" +test_pbc_number(7, "big-endian 64-bit, 16-byte long double"); # Local Variables: # mode: cperl Index: parrot-svn/t/native_pbc/string.t =================================================================== --- parrot-svn.orig/t/native_pbc/string.t 2009-02-28 01:01:45.342875000 +0100 +++ parrot-svn/t/native_pbc/string.t 2009-02-28 11:24:01.000000000 +0100 @@ -7,6 +7,7 @@ use lib qw( . lib ../lib ../../lib ); use Test::More; use Parrot::Config; +use Parrot::BuildUtil; use Parrot::Test tests => 1; @@ -20,12 +21,12 @@ =head1 DESCRIPTION -Tests word-size/string/endian-ness for different architectures. +Tests word-size/endian-ness for different architectures. +TODO: Test foreign charsets and encodings. -These tests usually only work on releases, not on svn checkouts -and if every release has updated native pbc test files. - -See F to create the platform-specific native pbcs. +These tests usually only work on updated native pbc test files. +See F to create the platform-specific +native pbcs. =head1 PLATFORMS @@ -34,7 +35,8 @@ _3 PPC BE 32 bit opcode_t, 32 bit intval (darwin-ppc) _4 x86_64 double float 64 bit opcode_t (linux-gcc-x86_64, solaris-cc-64int) _5 x86_64 16 bit long double 64 bit opcode_t (linux-gcc-x86_64, solaris-cc-64int) - _6 big-endian 64-bit (MIPS irix or similar) + _6 big-endian 64 bit opcode_t, 8 byte double (Sparc64/Solaris, MIPS irix) + _7 big-endian 64 bit opcode_t, 16 byte long double (Sparc64/Solaris, MIPS irix) =cut @@ -47,11 +49,24 @@ =cut +sub bc_version($) { + my $f = shift; + my $b; + open my $F, "<", "$f" or return "Can't open $f: $!"; + binmode $F; + seek $F, 14, 0; + read $F, $b, 8; + my ($bc_major, $bc_minor) = unpack "cc", $b; + return ($bc_major . "." . $bc_minor); +} +my ( $bc_major, $bc_minor ) = Parrot::BuildUtil::get_bc_version(); +my $bc = ($bc_major . "." . $bc_minor); + my $output = << 'END_OUTPUT'; -a2c -žÍœ -žÍœ -a2c +%Ec +Dw +ABCX + X END_OUTPUT # execute t/native_pbc/string_1.pbc @@ -60,30 +75,22 @@ # wordsize = 4 (interpreter's wordsize/INTVAL = 4/4) # byteorder = 0 (interpreter's byteorder = 0) # floattype = 0 (interpreter's NUMVAL_SIZE = 8) -# parrot-version 0.9.0, bytecode-version 3.34 +# parrot-version 0.9.1, bytecode-version 3.36 # UUID type = 0, UUID size = 0 # no endianize, no opcode, no numval transform # dirformat = 1 # ] -TODO: { - local $TODO; - if ($PConfig{ptrsize} == 8) { - $TODO = "Known problem on 64bit with reading 32bit dirs. See TT #254" - } elsif ($PConfig{DEVEL}) { - $TODO = "devel versions are not guaranteed to succeed"; - } else { - $TODO = "currently broken. See TT #254"; - } - -pbc_output_is( undef, $output, "i386 32 bit opcode_t, 32 bit intval" ); - -#pbc_output_is( undef, $output, "i386 32 bit opcode_t, 32 bit intval 12-byte long double" ); -#pbc_output_is( undef, $output, "PPC BE 32 bit opcode_t, 32 bit intval" ); -#pbc_output_is( undef, $output, "i86_64 LE 64 bit opcode_t, 64 bit intval" ); -#pbc_output_is( undef, $output, "i86_64 LE 64 bit opcode_t, 64 bit intval, 16-byte long double" ); -#pbc_output_is( undef, $output, "64bit BE 64 bit opcode_t, 64 bit intval" ); +SKIP: { + skip "Need to regenerate t/native_pbc/string_1.pbc; read test file", 1 + if ($bc ne bc_version("t/native_pbc/string_1.pbc")); + pbc_output_is( undef, $output, "i386 LE 32 bit opcode_t" ); } +#pbc_output_is( undef, $output, "i386 LE 32 bit opcode_t, 12-byte long double" ); +#pbc_output_is( undef, $output, "PPC BE 32 bit opcode_t" ); +#pbc_output_is( undef, $output, "i86_64 LE 64 bit opcode_t" ); +#pbc_output_is( undef, $output, "i86_64 LE 64 bit opcode_t, 16-byte long double" ); +#pbc_output_is( undef, $output, "64bit BE 64 bit opcode_t" ); # Local Variables: # mode: cperl Index: parrot-svn/tools/dev/mk_native_pbc =================================================================== --- parrot-svn.orig/tools/dev/mk_native_pbc 2009-02-28 01:01:45.452875000 +0100 +++ parrot-svn/tools/dev/mk_native_pbc 2009-02-28 10:22:34.171875000 +0100 @@ -51,7 +51,7 @@ # try --floatval="long double" and see if that makes 12 enable_long_double=1 # force double on 2nd run not to default to long double - conf=" --floatval='double'" + conf=" --floatval=double" fi else if [ "$byteorder" == "4321" ] @@ -83,14 +83,24 @@ # try --floatval="long double" and see if that makes 16 enable_long_double=1 # force double on 2nd run not to default to long double - conf=" --floatval='double'" + conf=" --floatval=double" else N=5 - echo "5: x86_64 double float 64 bit opcode_t, 16-byte long double" + echo "5: x86_64 64 bit opcode_t, 16-byte long double" fi else - N=6 - echo "6: big-endian 64-bit" + if [ "$numvalsize" == "8" ] + then + N=6 + echo "6: big-endian 64-bit" + # try --floatval="long double" and see if that makes 16 + enable_long_double=1 + # force double on 2nd run not to default to long double + conf=" --floatval=double" + else + N=7 + echo "7: ppc/BE 64 bit opcode_t, 16-byte long double" + fi fi else echo "unsupported ptrsize $ptrsize" Index: parrot-svn/t/op/string.t =================================================================== --- parrot-svn.orig/t/op/string.t 2009-02-18 00:01:52.000000000 +0100 +++ parrot-svn/t/op/string.t 2009-02-28 11:25:19.546875000 +0100 @@ -2358,6 +2358,7 @@ ok 10 OUTPUT +# string_133.pasm, used for t/native_pbc/string.t pasm_output_is( <<'CODE', <<'OUTPUT', 'bxors 2' ); set S1, "a2c" set S2, "Dw" @@ -2450,6 +2451,7 @@ SKIP: { skip( "No unicode yet", 1 ); + # This was the previous test used for t/native_pbc/string.t pasm_output_is( <<'CODE', <<'OUTPUT', 'bnots 2' ); getstdout P0 push P0, "utf8"