testing a cross compiler

I’ve been working with friends on a cross compiler based on LLVM for an experimental machine that’s currently only available as a simulator. While we’ve got it to compile, I’d like to test it (emphasizing the code generator rather than the front end or optimizer). Normally I’d approach such a problem by writing very many, very small test cases, but perhaps someone has already done this. At first glance, test-suite doesn’t seem quite right, with so many large programs and a complex infrastructure. Other ideas?


Hi Preston,

FWIW, at KernelGen we have “behavior tests” for a similar purpose - to test various aspects of code generation correctness: https://hpcforge.org/scm/viewvc.php/tests/behavior/?root=kernelgen

It’s not too big though, and is rather specialized on compute stuff. Also I’m not sure if it is “solid” enough and suites your needs it terms of focus, but still… Languages are C and Fortran. At least one positive side: the infrastructure is way simpler than LLVM test suite - just plain makefiles and comparison against reference results.

Best regards,

  • D.

2013/2/16 Preston Briggs <preston.briggs@gmail.com>