-
Notifications
You must be signed in to change notification settings - Fork 19
Testing the Checked C compiler
There are a lot of unit tests under the checkedc/tests directory. These tests can be run using LLVM's lit infrastructure as follows:
cd <BUILD_DIR>/llvm
bin/llvm-lit -v <SRC_DIR>/projects/checkedc-wrapper/checkedc/tests
By default, this would compile and run these tests for the native X86 target. You can also run these tests for other targets like ARM as follows:
Specify these two CMake options when configuring the compiler:
-DCHECKEDC_ARM_RUNUNDER=<device>
Specify the device to run the arm lit tests on. For example, specify this as qemu-arm
in order to run the tests on the ARM QEMU.
NOTE: If you want to run the tests on the QEMU, make sure that the QEMU is installed on the host machine.
-DCHECKEDC_ARM_SYSROOT=<sysroot>
Specify the path to the top of an ARM sysroot which contains the ARM-specific headers and runtime libs.
Once you have built the Checked C compiler, this is how you would invoke lit for ARM testing:
bin/llvm-lit -v <SRC_DIR>/projects/checkedc-wrapper/checkedc/tests -DCHECKEDC_TARGET=ARM