Research Article
Practical testing of a C99 compiler using output comparison
Article first published online: 3 APR 2007
DOI: 10.1002/spe.812
Copyright © 2007 John Wiley & Sons, Ltd.
Additional Information
How to Cite
Sheridan, F. (2007), Practical testing of a C99 compiler using output comparison. Softw: Pract. Exper., 37: 1475–1488. doi: 10.1002/spe.812
Publication History
- Issue published online: 9 OCT 2007
- Article first published online: 3 APR 2007
- Manuscript Accepted: 23 DEC 2006
- Manuscript Revised: 21 DEC 2006
- Manuscript Received: 21 DEC 2005
- Abstract
- References
- Cited By
Keywords:
- compilers;
- program testing;
- correctness
Abstract
A simple technique is presented for testing a C99 compiler, by comparing its output with the output from pre-existing tools. The advantage to this approach is that new test cases can be added in bulk from existing sources, reducing the need for in-depth investigation of correctness issues and for creating new test code by hand. This technique was used in testing the PalmSource Palm OS® Cobalt ARM C/C++ cross-compiler for Palm-Powered® personal digital assistants, primarily for standards compliance and the correct execution of generated code. The technique described here found several hundred bugs, mostly in our in-house code, but also in longstanding high-quality front- and back-end code from Edison Design Group and Apogee Software. It also found 18 bugs in the GNU C compiler, as well as a bug specific to the Apple version of GCC, a bug specific to the Suse version of GCC, and a dozen bugs in versions of GCC for the ARM processor, several of which were critical. Copyright © 2007 John Wiley & Sons, Ltd.

1097-024X/asset/olbannerleft.jpg?v=1&s=2d7d001211f2c40f177a231141601e9f52afc1f3)
1097-024X/asset/olbannerright.jpg?v=1&s=3aec7891a8ba78b361ead9743adfc0b6eae6369a)
1097-024X/asset/cover.gif?v=1&s=5a70ecca2928358eca4ff75b9921d0552ffb6539)