Unit testing a compiler

"Rafael R. Sevilla" <dido@imperium.ph>
Wed, 13 Mar 2013 11:50:30 +0800

          From comp.compilers

Related articles
Unit testing a compiler dido@imperium.ph (Rafael R. Sevilla) (2013-03-13)
Re: Unit testing a compiler cr88192@hotmail.com (BGB) (2013-03-13)
Re: Unit testing a compiler bobduff@shell01.TheWorld.com (Robert A Duff) (2013-03-13)
Re: Unit testing a compiler walter@bytecraft.com (Walter Banks) (2013-03-19)
| List of all articles for this month |

From: "Rafael R. Sevilla" <dido@imperium.ph>
Newsgroups: comp.compilers
Date: Wed, 13 Mar 2013 11:50:30 +0800
Organization: Compilers Central
Keywords: testing, debug, question
Posted-Date: 13 Mar 2013 00:03:26 EDT

I am currently writing a simple byte compiler for a simple dialect of
Lisp, and am wondering what is the best practice for testing such a
compiler. It is certainly possible to run the compiler on some test
code and then compare the code it generates with some reference code,
but as the code samples become more complicated that rapidly becomes
unwieldy. Would it instead be better to test the compiler by actually
running the code it generates, and then comparing the results with what
the code snippet is supposed to evaluate to? Any other ideas on how to
go about testing the code generator? What about when optimizations are
being performed?

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.