-
Notifications
You must be signed in to change notification settings - Fork 0
/
klee-coreutil.sh
executable file
·48 lines (39 loc) · 1.07 KB
/
klee-coreutil.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
# Coreutils run with Klee
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/x86_64-linux-gnu
sudo apt-get install python-pip
sudo pip install tabulate
cd ~/source
curl -O http://ftp.gnu.org/gnu/coreutils/coreutils-6.11.tar.gz
tar xvzf coreutils-6.11.tar.gz
# gcov
cd ~/source/coreutils-6.11
mkdir obj-gcov
cd obj-gcov
../configure --disable-nls CFLAGS="-g -fprofile-arcs -ftest-coverage"
make
make -C src arch hostname
# llvm
cd ~/source/coreutils-6.11
mkdir obj-llvm
cd obj-llvm
../configure --disable-nls CFLAGS="-g"
export cc=~/source/klee/scripts/klee-gcc
make CC=$cc
make -C src arch hostname CC=$cc
# visual tests
cd ~/source/coreutils-6.11/obj-gcov/src
ls -l ls echo cat
./cat --version
rm -f *.gcda
./echo "Yes"
ls -l echo.gcda
gcov echo
cd ~/source/coreutils-6.11/obj-llvm/src
ls -l ls echo cat
klee --libc=uclibc --posix-runtime ./cat.bc --version
klee --libc=uclibc --posix-runtime ./echo.bc --help
klee --libc=uclibc --posix-runtime ./echo.bc --sym-arg 3
klee-stats klee-last
klee --optimize --libc=uclibc --posix-runtime ./echo.bc --sym-arg 3
klee-stats klee-last