Test Code for C-like Compilers

Julian Mensch <jmensch@shaw.ca>
Sun, 8 Mar 2009 22:53:20 -0700 (PDT)

          From comp.compilers

Related articles
Test Code for C-like Compilers jmensch@shaw.ca (Julian Mensch) (2009-03-08)
Re: Test Code for C-like Compilers kamalpr@hp.com (kamal) (2009-03-14)
Re: Test Code for C-like Compilers ian@airs.com (Ian Lance Taylor) (2009-03-15)
| List of all articles for this month |

From: Julian Mensch <jmensch@shaw.ca>
Newsgroups: comp.compilers
Date: Sun, 8 Mar 2009 22:53:20 -0700 (PDT)
Organization: Compilers Central
Keywords: testing, debug, question
Posted-Date: 10 Mar 2009 15:28:25 EDT

    So my project has a scripting language that has C-like expressions
and control flow structures, and some very limited aspects of C++
scoping. I'm just recoding the grammar using ANTLR (while learning
ANTLR in so doing), and am also refactoring the bytecode side of
things for greater language power -- and all this has me rather
nervous about subtle bugs, since I'm on a schedule and have to move
straight from getting the compiler working into using it to build and
debug code that may or may not be working correctly. I don't want my
first doubt to always be, "what if there's a bug in the compiler?"


    I was wondering if anyone here knows of some good, publicly
available test code for C-like compilers -- samples designed to catch
and point out subtle bugs in compilers like operator precedence
glitches, subtle unexpected behavior with control flow, etc. Anyone
can throw together some simple code tests, but I'm wondering if anyone
with some experience in compiler design has ever written something
like this for public use, that will catch things that whatever I might
come up with wouldn't, because I'm not a compiler expert and don't
necessarily know what to test for.


    Thanks to anyone who can offer insight,


-- Julian Mensch



Post a followup to this message

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