Finding and Understanding Bugs in C Compilers
lambda-the-ultimate.org
lambda-the-ultimate.org
regehr@home:~/volatile/bugs/tmp007$ cparser --version
cparser (0.9.11) using libFirm (1.18)
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
regehr@home:~/volatile/bugs/tmp007$ cparser -c small.c
cparser: ast2firm.c:3197: conditional_to_firm: Assertion `get_irn_mode(false_val) == mode' failed.
Aborted
regehr@home:~/volatile/bugs/tmp007$ cat small.c
unsigned char foo (int ui1, unsigned char ui2)
{
return ui2 ? : ui1 + ui2;
}If I'm writing test cases with the goal of increasing (line) coverage, I first look for large sections of code that aren't yet covered, then test the most obvious path to reach those lines (usually its some sort of special case or error handler). Sometimes this catches really simple mistakes, but generally those lines were written specifically to handle the the path I'm testing. The problem is that once I've tested that path I'm inclined to move on to un-covered lines, and don't test a lot of paths that exercise the same code, but that aren't necessarily obvious to me. Such paths, of course, tend to be more likely to contain bugs because they weren't as obvious to, or considered as critical by whoever originally wrote the code.
1: https://secure.wikimedia.org/wikipedia/en/wiki/Mutation_test...