expected.tsv 4.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. # Expected results for tests/fixtures/*.pas - one line per fixture:
  2. #
  3. # <fixture-basename> OK <code> <data>
  4. # <fixture-basename> ERR <tp3-error-no> <relative-pos>
  5. #
  6. # Both the verdict AND the numbers are asserted by run_compile_tests.sh, so a
  7. # regression in the *reported error position* fails the suite just like a
  8. # regression in the generated code. That matters: error positions were once
  9. # silently wrong (a multi-character string literal swallowed the rest of the
  10. # source, so every later error pointed at end-of-file), and nothing caught it
  11. # because the old harness only printed the position for a human to squint at.
  12. #
  13. # Re-baseline deliberately, never to make a red test go green: if a fixture's
  14. # expectation has to change because the compiler legitimately improved, change
  15. # it in the same commit as the fix and say why in the message.
  16. #
  17. # ERR 102 = ENoLib, the original's "not implemented" path. The remaining ERR
  18. # rows are unimplemented features, not parser bugs:
  19. # t14 'array [..] of <type>' at its point of use
  20. # t25 a string literal used where a 16-bit word is wanted
  21. # uierror deliberate syntax error, pinned by the editor UI test
  22. #
  23. # t02 t03 t05 t17 used to be ERR 102 as well: a multi-character literal was
  24. # rejected because writeln had no string support. They compile now, via the
  25. # inline-string path (CALL wrtinl, then <length><chars> in the code stream -
  26. # TPSRC8 pwrinlin / TPSRC4 xwrtinl), so their rows changed from ERR to OK and
  27. # their code sizes went up by the literal's own bytes.
  28. #
  29. # RE-BASELINED when the runtime was wired into the code buffer. Every OK row
  30. # changed by exactly +3 code and -256 data, and both numbers are correct:
  31. #
  32. # +3 code the prologue now emits MOV AX,<header offset> before
  33. # CALL TU_InitMem, because InitMem takes the header offset in a
  34. # register (B8 lo hi) rather than on the stack. Previously the
  35. # prologue called offset 8, which is the hdrMax word - it only
  36. # "worked" because the runtime was not in the image at all.
  37. #
  38. # -256 data DataBytes() used to return dc, the ABSOLUTE end of the data
  39. # area, not a size. dc started at 100H, so every program reported
  40. # 256 more than it allocated - 260 for a program whose only data is
  41. # the two @@T1/@@T2 scratch words. The field is documented as
  42. # "emitted data size in bytes", so 4 is the true size and 260 was
  43. # the bug. It is a real correction, not a fit-to-the-test change:
  44. # the 6-byte rows are the fixtures that declare one global.
  45. #
  46. # ADDED for the BP displacement fix. These two fixtures are the first with
  47. # any frame access at all -- every earlier fixture put its variables in the
  48. # DATA segment, addressed absolutely, so the whole [BP+off] path had zero
  49. # coverage and a truncation there was invisible.
  50. #
  51. # t27_localvar five LOCAL variables, assigned and read back. Locals are
  52. # allocated downward from 0FFFEh and each access now costs 4
  53. # bytes (mod=10 + disp16) where it cost 3 (disp8), so its code
  54. # size reflects the fix rather than predating it. Both
  55. # encodings address the same place; only the rule for choosing
  56. # between them changed.
  57. # t28_farparam 70 declared parameters; the call passes 16, which is the
  58. # argument cap at the call site. p63 lands at BP+128 and p70
  59. # at BP+142 - the first offsets a disp8 cannot represent,
  60. # since 80h is -128 and not +128. Under the old code these
  61. # two reads came from the wrong side of BP. This fixture
  62. # tests the ENCODING and is never executed; do not read it as
  63. # a claim that a 70-argument call works. Its 123 bytes are
  64. # 1 more than t27's because the body is one ADD and one
  65. # store rather than five of each.
  66. t01_minimal OK 29 4
  67. t02_writeln OK 38 4
  68. t03_inline_comment OK 38 4
  69. t04_var OK 48 6
  70. t05_own_line_comment OK 38 4
  71. t06_two_args OK 52 4
  72. t07_big OK 102 6
  73. t08_const OK 35 6
  74. t09_if OK 67 6
  75. t10_while OK 75 6
  76. t11_for OK 69 6
  77. t12_repeat OK 72 6
  78. t13_proc OK 53 6
  79. t14_types ERR 102 83
  80. t15_label OK 38 6
  81. t16_str1 OK 42 4
  82. t17_two_str OK 45 4
  83. t18_writeln_bare OK 32 4
  84. t19_int1 OK 42 4
  85. t20_str3 OK 62 4
  86. t21_mixed OK 62 4
  87. t22_case OK 96 6
  88. t23_str_empty OK 36 4
  89. t24_str_quote OK 41 4
  90. t25_str_as_value ERR 102 48
  91. t26_str_mixed_args OK 58 4
  92. t27_localvar OK 122 6
  93. t28_farparam OK 123 6
  94. uierror ERR 41 331