I thought I'd try out newasm on the test suite - this is how we do:
Failed Test Status Wstat Total Fail Failed List of failed ------------------------------------------------------------- t/op/basic.t 2 512 8 2 25.00% 3, 7 t/op/bitwise.t 15 3840 15 15 100.00% 1-15 t/op/ifunless.t 2 512 6 2 33.33% 1, 4 t/op/integer.t 1 256 32 1 3.12% 9 t/op/macro.t 8 2048 9 8 88.89% 1-4, 6-9 t/op/number.t 1 256 31 1 3.23% 13 t/op/rx.t 25 6400 27 25 92.59% 1-16, 18-26 t/op/stacks.t 4 1024 15 4 26.67% 3-4, 13-14 t/op/time.t 1 256 4 1 25.00% 2 t/op/trans.t 18 4608 18 18 100.00% 1-18 t/pmc/perlstrin 7 1792 8 7 87.50% 1-4, 6-8 t/pmc/pmc.t 55 14080 56 55 98.21% 1-32, 34-56 20 subtests skipped. Failed 12/19 test scripts, 36.84% okay. 139/313 subtests failed, 55.59% okay. In detail: basic.t - test 3 fails because the assembler doesn't recognise string constants in single quotes - test 7 uses macros bitwise.t - these tests fail because the assembler translates binary constants like 0b001100 to zero. ifunless.t, integer.t, number.t - the failing tests use the full op names; my patch of yesterday fixes this macro.t - we don't have macros any more rx.t - these tests all use local labels; if you change them to globals, all tests pass stacks.t - tests 4,13 & 14 all create PMCs, so won't work until the assembler groks PMC names - I have no idea why test 3 is failing time.t - test 2 has a line: ge N0, 0, OK1 which isn't valid assembler, as there's no ge_n_i_i opcode; the fact that it's been passing up to now probably shows up a bug in assemble.pl trans.t - these use a macro to do floating point comparisons, so don't work with the new assembler perlstring.t, pmc.t - these create PMCs (obviously) so don't work right now Attached are patches for time.t (to fix the test) and rx.t (to change the local labels to globals). Simon --- t/op/time.t.old Sat Mar 16 15:58:29 2002 +++ t/op/time.t Sat Mar 16 15:58:33 2002 @@ -28,7 +28,7 @@ output_is(<<'CODE', <<'OUTPUT', "time_n"); time N0 time N1 - ge N0, 0, OK1 + ge N0, 0.0, OK1 branch FAIL OK1: print "ok, (!= 1970) Grateful Dead not\n" ge N1, N0, OK2 --- t/op/rx.t.old Sat Mar 16 15:21:42 2002 +++ t/op/rx.t Sat Mar 16 15:22:35 2002 @@ -10,10 +10,10 @@ rx_allocinfo P0, S0 bsr RX_0 rx_info_successful P0, I0 - if I0, \$yup + if I0, yup print "no match\\n" end - \$yup: + yup: rx_info_getstartindex P0, I1 rx_info_getindex P0, I2 length I3, S0 @@ -38,122 +38,122 @@ RX_0: rx_setprops P0, "$_[2]", $_[3] - branch \$start - \$advance: - rx_advance P0, \$fail - \$start: + branch start + advance: + rx_advance P0, fail + start: $_[1] rx_succeed P0 ret - \$fail: + fail: rx_fail P0 ret END } output_is(gentest('a', <<'CODE'), <<'OUTPUT', 'A is A'); - rx_literal P0, "a", $advance + rx_literal P0, "a", advance CODE <><a><> OUTPUT output_is(gentest('b', <<'CODE'), <<'OUTPUT', 'A is not B'); - rx_literal P0, "a", $advance + rx_literal P0, "a", advance CODE no match OUTPUT output_is(gentest('a', <<'CODE'), <<'OUTPUT', 'Pattern longer than string'); - rx_literal P0, "aa", $advance + rx_literal P0, "aa", advance CODE no match OUTPUT output_is(gentest('ba', <<'CODE'), <<'OUTPUT', 'inching through the string'); - rx_literal P0, "a", $advance + rx_literal P0, "a", advance CODE <b><a><> OUTPUT output_is(gentest('a', <<'CODE'), <<'OUTPUT', 'character classes (successful)'); - rx_oneof P0, "aeiou", $advance + rx_oneof P0, "aeiou", advance CODE <><a><> OUTPUT output_is(gentest('b', <<'CODE'), <<'OUTPUT', 'character classes (failure)'); - rx_oneof P0, "aeiou", $advance + rx_oneof P0, "aeiou", advance CODE no match OUTPUT output_is(gentest('a', <<'CODE'), <<'OUTPUT', 'dot (success)'); - rx_dot P0, $advance + rx_dot P0, advance CODE <><a><> OUTPUT output_is(gentest('\n', <<'CODE'), <<'OUTPUT', 'dot (failure)'); - rx_dot P0, $advance + rx_dot P0, advance CODE no match OUTPUT output_is(gentest('aA9_', <<'CODE'), <<'OUTPUT', '\w (success)'); - rx_is_w P0, $advance - rx_is_w P0, $advance - rx_is_w P0, $advance - rx_is_w P0, $advance + rx_is_w P0, advance + rx_is_w P0, advance + rx_is_w P0, advance + rx_is_w P0, advance CODE <><aA9_><> OUTPUT output_is(gentest('?', <<'CODE'), <<'OUTPUT', '\w (failure)'); - rx_is_w P0, $advance + rx_is_w P0, advance CODE no match OUTPUT output_is(gentest('0123456789', <<'CODE'), <<'OUTPUT', '\d (success)'); - rx_is_d P0, $advance - rx_is_d P0, $advance - rx_is_d P0, $advance - rx_is_d P0, $advance - rx_is_d P0, $advance - rx_is_d P0, $advance - rx_is_d P0, $advance - rx_is_d P0, $advance - rx_is_d P0, $advance - rx_is_d P0, $advance + rx_is_d P0, advance + rx_is_d P0, advance + rx_is_d P0, advance + rx_is_d P0, advance + rx_is_d P0, advance + rx_is_d P0, advance + rx_is_d P0, advance + rx_is_d P0, advance + rx_is_d P0, advance + rx_is_d P0, advance CODE <><0123456789><> OUTPUT output_is(gentest('@?#', <<'CODE'), <<'OUTPUT', '\d (failure)'); - rx_is_d P0, $advance - rx_is_d P0, $advance - rx_is_d P0, $advance + rx_is_d P0, advance + rx_is_d P0, advance + rx_is_d P0, advance CODE no match OUTPUT output_is(gentest(' ', <<'CODE'), <<'OUTPUT', '\s (success)'); - rx_is_s P0, $advance + rx_is_s P0, advance CODE <>< ><> OUTPUT output_is(gentest('a', <<'CODE'), <<'OUTPUT', '\s (failure)'); - rx_is_s P0, $advance + rx_is_s P0, advance CODE no match OUTPUT output_is(gentest('a', <<'CODE'), <<'OUTPUT', 'stack (pushindex/popindex)'); rx_pushindex P0 - rx_literal P0, "a", $advance - rx_popindex P0, $advance + rx_literal P0, "a", advance + rx_popindex P0, advance CODE <><><a> OUTPUT @@ -161,9 +161,9 @@ output_is(gentest('a', <<'CODE'), <<'OUTPUT', 'stack (pushmark)'); rx_pushmark P0 rx_pushindex P0 - rx_literal P0, "a", $advance - rx_popindex P0, $advance - rx_popindex P0, $advance + rx_literal P0, "a", advance + rx_popindex P0, advance + rx_popindex P0, advance CODE no match OUTPUT @@ -171,7 +171,7 @@ SKIP: { skip("Arrays are still wacky", 1); output_is(gentest('a', <<'CODE'), <<'OUTPUT', 'groups'); rx_startgroup P0, 0 - rx_literal P0, "a", $advance + rx_literal P0, "a", advance rx_endgroup P0, 0 rx_info_getgroup P0, I1, I2, 0 @@ -187,65 +187,65 @@ } output_is(gentest('a', <<'CODE'), <<'OUTPUT', 'ZWA: ^ (success)'); - rx_zwa_atbeginning P0, $advance - rx_literal P0, "a", $advance + rx_zwa_atbeginning P0, advance + rx_literal P0, "a", advance CODE <><a><> OUTPUT output_is(gentest('b', <<'CODE'), <<'OUTPUT', 'ZWA: ^ (failure)'); - rx_zwa_atbeginning P0, $advance - rx_literal P0, "a", $advance + rx_zwa_atbeginning P0, advance + rx_literal P0, "a", advance CODE no match OUTPUT -output_is(gentest('a', <<'CODE'), <<'OUTPUT', 'ZWA: $ (success)'); - rx_literal P0, "a", $advance - rx_zwa_atend P0, $advance +output_is(gentest('a', <<'CODE'), <<'OUTPUT', 'ZWA: (success)'); + rx_literal P0, "a", advance + rx_zwa_atend P0, advance CODE <><a><> OUTPUT -output_is(gentest('ab', <<'CODE'), <<'OUTPUT', 'ZWA: $ (failure)'); - rx_literal P0, "a", $advance - rx_zwa_atend P0, $advance +output_is(gentest('ab', <<'CODE'), <<'OUTPUT', 'ZWA: (failure)'); + rx_literal P0, "a", advance + rx_zwa_atend P0, advance CODE no match OUTPUT output_is(gentest('a?', <<'CODE'), <<'OUTPUT', 'ZWA: \b (success)'); - rx_literal P0, "a", $advance - rx_zwa_boundary P0, $advance + rx_literal P0, "a", advance + rx_zwa_boundary P0, advance CODE <><a><?> OUTPUT output_is(gentest('ab', <<'CODE'), <<'OUTPUT', 'ZWA: \b (failure)'); - rx_literal P0, "a", $advance - rx_zwa_boundary P0, $advance + rx_literal P0, "a", advance + rx_zwa_boundary P0, advance CODE no match OUTPUT output_is(gentest('ba', <<'CODE', 'r'), <<'OUTPUT', 'reversed regexen (/r)'); - rx_dot P0, $advance + rx_dot P0, advance CODE <b><a><> OUTPUT output_is(gentest('\n', <<'CODE', 's'), <<'OUTPUT', 'single-line regexen (/s)'); - rx_dot P0, $advance + rx_dot P0, advance CODE <>< ><> OUTPUT output_is(gentest('\n\n', <<'CODE', 'm'), <<'OUTPUT', 'multiline regexen (/m)'); - rx_literal P0, "\n", $advance - rx_zwa_atbeginning P0, $advance - rx_zwa_atend P0, $advance + rx_literal P0, "\n", advance + rx_zwa_atbeginning P0, advance + rx_zwa_atend P0, advance CODE <>< >< @@ -255,9 +255,9 @@ SKIP: { skip("Pending some sort of lowercasing op",1); output_is(gentest('HeLlO', <<'CODE', 'i'), <<'OUTPUT', 'case-insensitive regexen (/i)'); - rx_literal P0, "hel", $advance - rx_oneof P0, "lmno", $advance - rx_oneof P0, "lmno", $advance + rx_literal P0, "hel", advance + rx_oneof P0, "lmno", advance + rx_oneof P0, "lmno", advance CODE <><HeLlO><> OUTPUT