umount-test-opts

Equivalence checking of BusyBox and util-linux umount(8) -O option handling

git clone https://git.8pit.net/umount-test-opts.git

 1CLANG ?= clang
 2GCC   ?= gcc
 3
 4KLEE_INCLUDE = /home/klee/klee_src/include
 5KLEE_LIB     = /home/klee/klee_build/lib
 6
 7CPPFLAGS += -I$(KLEE_INCLUDE)
 8CFLAGS += -g -O0 -Xclang -disable-O0-optnone
 9
10INPUT_SIZE ?= 8
11CFLAGS_SIZE = -DINPUT_SIZE=$(INPUT_SIZE)
12
13main.bc: main.c busybox.h util-linux.h
14# Binary for replying generated test inputs (for debugging etc.).
15# See: https://klee.github.io/tutorials/testing-function/#replaying-a-test-case
16main: main.c busybox.h util-linux.h
17	$(GCC) $(CPPFLAGS) -g3 -L$(KLEE_LIB) $< -o $@ $(CFLAGS_SIZE)
18
19%.bc: %.c
20	$(CLANG) -emit-llvm -c -o $@ $< $(CPPFLAGS) $(CFLAGS) $(CFLAGS_SIZE)
21
22sim: main.bc
23	klee --solver-backend=z3 \
24		--max-memory=$(shell expr 1024 \* 1024 \* 1024) \
25		--exit-on-error \
26		--libc=uclibc \
27		--posix-runtime \
28		--check-div-zero=false \
29		--check-overshift=false \
30		--write-no-tests \
31		$<
32
33clean:
34	rm -f main main.bc
35
36.PHONY: sim clean