← board

ExitCode + finalization execution + Halt semantics (unblocks the erroru test family)

What FPC does (and the testsuite's erroru.pp depends on, in order)

  1. ExitCode: Longint is a writable global in System scope.
  2. Halt(n) sets ExitCode := n, then runs unit finalization sections (reverse init order), then terminates with ExitCode.
  3. Halt (no arg) = terminate with current ExitCode; normal program end also exits with ExitCode.
  4. A finalization section may WRITE ExitCode (erroru's error_unit_exit checks the recorded exit code against the accepted/required error number and then zeroes it, turning an expected halt(100) into process exit 0 — that is how every accept_error/require_error test passes).

pxx today

Scope sketch

Unblocks (conformance skip list)

tstring2.pp, tstring5.pp, texception3.pp, tobject1.pp (partly — also needs constructor fail), and every future erroru-using test the curated categories pick up.