-
Use and Customize CSmith to automatically generate C programs.
-
Test whether there is any difference in the outputs of the same program compiled by GCC and Clang.
$ git clone https://github.com/sheisc/CompilerTesting.git
$ cd CompilerTesting
CompilerTesting$ ./setup.sh
CompilerTesting$ source ./env.sh
ompilerTesting$ make
Thread 0 is starting ...
Thread 1 is starting ...
Thread 2 is starting ...
Thread 3 is starting ...
You can press CTRL+C to stop all the threads
CTRL + C
CompilerTesting$ make clean├── BugsFound bugs found by difference testing
├── build_run.py build and run a C program
├── csmith_driver.py main() for difference testing in gcc and clang
├── CStandard the C language standard
├── env.sh set environment variables
├── Makefile start everything
├── README.md
├── replay.py replay one bug (a C program automatically generated by CSmith) found
└── setup.sh install llvm and csmith