Skip to content
jdfrens edited this page Sep 12, 2010 · 1 revision

Say I have multiple targets:

  • a to-PIR compiler
  • an optimizing to-PIR compiler
  • a to-PPC compiler
    Is there a benefit to writing one acceptance test for all three targets?

Output should be the same so there’s a benefit to not repeating it in three separate files.

Allowing all three targets into one test file would mean extra complexity in parsing the files.

This implies, though, that good tests for PIR generation are also good test for PPC generation (and vice versa). Even at the “compile and integer” stage, this isn’t true. Printing “5” and “32000” are pretty much the same in PIR; they’re very different in PPC. Same for negative numbers. So I’d imagine there’s more to be tested (even at an acceptance level) with PPC.

The increased complexity in parsing and the minimal benefit (if any) leads me to put this low on the list of features to be added.