aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2021-04-20 11:38:09 +0200
committerGitHub <noreply@github.com>2021-04-20 11:38:09 +0200
commit48cef3c74727407f82c44800d382737265fe65b4 (patch)
tree07338ec82703c20cc1f78a235ac3ad16e2465bf1 /test
parentf7179e44f6c46fef318b6413d9c00693c1af4602 (diff)
parent3b5fa3632b0e482b2915709d7fbec827e1d997b9 (diff)
downloadafl++-48cef3c74727407f82c44800d382737265fe65b4.tar.gz
Merge pull request #871 from AFLplusplus/dev
push to stable
Diffstat (limited to 'test')
-rwxr-xr-xtest/test-llvm.sh25
-rwxr-xr-xtest/test-pre.sh1
2 files changed, 4 insertions, 22 deletions
diff --git a/test/test-llvm.sh b/test/test-llvm.sh
index 3ef36b37..06d0a0f8 100755
--- a/test/test-llvm.sh
+++ b/test/test-llvm.sh
@@ -46,7 +46,8 @@ test -e ../afl-clang-fast -a -e ../split-switches-pass.so && {
../afl-clang-fast -DTEST_SHARED_OBJECT=1 -z defs -fPIC -shared -o test-instr.so ../test-instr.c > /dev/null 2>&1
test -e test-instr.so && {
$ECHO "$GREEN[+] llvm_mode shared object with -z defs compilation succeeded"
- ../afl-clang-fast -o test-dlopen.plain test-dlopen.c -ldl > /dev/null 2>&1
+ test `uname -s` = 'Linux' && LIBS=-ldl :
+ ../afl-clang-fast -o test-dlopen.plain test-dlopen.c ${LIBS} > /dev/null 2>&1
test -e test-dlopen.plain && {
$ECHO "$GREEN[+] llvm_mode test-dlopen compilation succeeded"
echo 0 | TEST_DLOPEN_TARGET=./test-instr.so AFL_QUIET=1 ./test-dlopen.plain > /dev/null 2>&1
@@ -81,6 +82,7 @@ test -e ../afl-clang-fast -a -e ../split-switches-pass.so && {
CODE=1
}
rm -f test-dlopen.plain test-dlopen.plain.0 test-dlopen.plain.1 test-instr.so
+ unset LIBS
} || {
$ECHO "$RED[!] llvm_mode shared object with -z defs compilation failed"
CODE=1
@@ -166,27 +168,6 @@ test -e ../afl-clang-fast -a -e ../split-switches-pass.so && {
}
rm -f test-instr.plain
- # now for the special llvm_mode things
- test -e ../libLLVMInsTrim.so && {
- AFL_LLVM_INSTRUMENT=CFG AFL_LLVM_INSTRIM_LOOPHEAD=1 ../afl-clang-fast -o test-instr.instrim ../test-instr.c > /dev/null 2>test.out
- test -e test-instr.instrim && {
- TUPLES=`echo 0|AFL_QUIET=1 ../afl-showmap -m ${MEM_LIMIT} -o /dev/null -- ./test-instr.instrim 2>&1 | grep Captur | awk '{print$3}'`
- test "$TUPLES" -gt 1 -a "$TUPLES" -lt 5 && {
- $ECHO "$GREEN[+] llvm_mode InsTrim reported $TUPLES instrumented locations which is fine"
- } || {
- $ECHO "$RED[!] llvm_mode InsTrim instrumentation produces weird numbers: $TUPLES"
- CODE=1
- }
- rm -f test-instr.instrim test.out
- } || {
- cat test.out
- $ECHO "$RED[!] llvm_mode InsTrim compilation failed"
- CODE=1
- }
- } || {
- $ECHO "$YELLOW[-] llvm_mode InsTrim not compiled, cannot test"
- INCOMPLETE=1
- }
AFL_LLVM_INSTRUMENT=AFL AFL_DEBUG=1 AFL_LLVM_LAF_SPLIT_SWITCHES=1 AFL_LLVM_LAF_TRANSFORM_COMPARES=1 AFL_LLVM_LAF_SPLIT_COMPARES=1 ../afl-clang-fast -o test-compcov.compcov test-compcov.c > test.out 2>&1
test -e test-compcov.compcov && test_compcov_binary_functionality ./test-compcov.compcov && {
grep --binary-files=text -Eq " [ 123][0-9][0-9] location| [3-9][0-9] location" test.out && {
diff --git a/test/test-pre.sh b/test/test-pre.sh
index 85ac320b..174f2f7f 100755
--- a/test/test-pre.sh
+++ b/test/test-pre.sh
@@ -71,6 +71,7 @@ unset AFL_HARDEN
unset AFL_USE_ASAN
unset AFL_USE_MSAN
unset AFL_USE_UBSAN
+unset AFL_USE_LSAN
unset AFL_TMPDIR
unset AFL_CC
unset AFL_PRELOAD