Add fuzz testing of input programs.

When the --fuzz-test command-line option is given, the input program
will be randomly perturbed by the lexer in an effort to trigger
assertions or crashes in the compiler (neither of which should ever
happen, even for malformed programs.)
This commit is contained in:
Matt Pharr
2012-02-06 13:59:14 -08:00
parent b7c5af7e64
commit 3efbc71a01
6 changed files with 366 additions and 105 deletions

8
ispc.h
View File

@@ -405,6 +405,14 @@ struct Globals {
vector width to them. */
bool mangleFunctionsWithTarget;
/** If enabled, the lexer will randomly replace some tokens returned
with other tokens, in order to test error condition handling in the
compiler. */
bool enableFuzzTest;
/** Seed for random number generator used for fuzz testing. */
int fuzzTestSeed;
/** Global LLVMContext object */
llvm::LLVMContext *ctx;