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:
7
sym.h
7
sym.h
@@ -244,6 +244,13 @@ public:
|
||||
(Debugging method). */
|
||||
void Print();
|
||||
|
||||
/** Returns a random symbol from the symbol table. (It is not
|
||||
guaranteed that it is equally likely to return all symbols). */
|
||||
Symbol *RandomSymbol();
|
||||
|
||||
/** Returns a random type from the symbol table. */
|
||||
const Type *RandomType();
|
||||
|
||||
private:
|
||||
std::vector<std::string> closestTypeMatch(const char *str,
|
||||
bool structsVsEnums) const;
|
||||
|
||||
Reference in New Issue
Block a user