Skip to content

Running the Checked C LLVM test suite on Windows

Katherine Kjeer edited this page Jan 23, 2020 · 2 revisions

Checked C LLVM Testing

The LLVM test suite contains a modified version of the LLVM test-suite repo that is used to benchmark the Checked C version of LLVM/clang.

1. Check out the LLVM test suite

The LLVM test suite for Checked C is at the LLVM test suite repo. To run these tests on Windows, check out the repository:

git clone -c core.autocrlf=false https://github.com/microsoft/checkedc-llvm-test-suite

2. Compile the LLVM test suite files

If the Checked C version of clang has been added to your path, use the following to compile an LLVM benchmark file:

clang checkedc-llvm-test-suite/path/to/benchmark

For example, to compile the LLVM test suite file MultiSource/Benchmarks/Olden/bh/args.c, run:

clang checkedc-llvm-test-suite/MultiSource/Benchmarks/Olden/bh/args.c

If you have the checkedc-clang repo checked out and built at BUILD_DIR, run:

<BUILD_DIR>/Debug/bin/clang.exe checkedc-llvm-test-suite/path/to/benchmark

3. Adjust header files and definitions

Some LLVM test suite files may #include headers or #define variables that are missing on Windows. In order to compile these files, look at the relevant makefiles to see which headers need to be included.

Some files also need certain command line arguments in order to compile on Windows. For example, the file MultiSource/Benchmarks/Olden/bh/walksub.c should be compiled as follows:

clang checkedc-llvm-test-suite/MultiSource/Benchmarks/Olden/bh/walksub.c -D TORONTO