-
-
Save disruptek/bb875a27a1024e642bfc8e4827c67015 to your computer and use it in GitHub Desktop.
steps to generate some klee test results
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/fish | |
# set some locations | |
set --local root /root | |
set --local temp $root/temp | |
set --local output $root/linked.bc | |
set --local cache $root/cache | |
pushd $root | |
if test -f $output | |
rm $output | |
end | |
if test -d $temp | |
rm -rf $temp | |
end | |
mkdir --parents $temp | |
# clear the cache so we can iterate over all c files | |
rm -rf $cache | |
# compile our nim code | |
nim --nimCache:$cache --debuginfo:on --opt:none --lineTrace:on --threads:off --checks:on --assertions:on --embedsrc:on --compileOnly:on --lineDir:on --forceBuild:on $argv; or exit 1 | |
# compile c to bc | |
for n in $cache/*.c | |
set --local out (basename $n) | |
clang -I /klee/klee/include -I /root/Nim/lib -emit-llvm -c -g -O0 -Xclang -disable-O0-optnone $n -o $temp/$out.bc; or exit 1 | |
end | |
# link the bytecode to a single output file | |
llvm-link -S $temp/*.bc -o $output |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment