tsan: fix output_tests script to actually verify tests results

llvm-svn: 156764
This commit is contained in:
Dmitry Vyukov 2012-05-14 15:25:35 +00:00
parent 066fba1a82
commit d004b99cc6
1 changed files with 5 additions and 9 deletions

View File

@ -1,6 +1,6 @@
#!/bin/bash
ulimit -s 8192;
ulimit -s 8192
set -e # fail on any error
ROOTDIR=$(dirname $0)/..
@ -10,11 +10,8 @@ CC=clang
CXX=clang++
# TODO: add testing for all of -O0...-O3
CFLAGS="-fthread-sanitizer -fPIE -O1 -g -fno-builtin -Wall -Werror=return-type"
CFLAGS="-fthread-sanitizer -fPIE -O1 -g -fno-builtin -Wall"
LDFLAGS="-pie -lpthread -ldl $ROOTDIR/rtl/libtsan.a"
if [ "$LLDB" != "" ]; then
LDFLAGS+=" -L$LLDB -llldb"
fi
test_file() {
SRC=$1
@ -23,9 +20,8 @@ test_file() {
OBJ=$SRC.o
EXE=$SRC.exe
$COMPILER $SRC $CFLAGS -c -o $OBJ
# Link with CXX, because lldb and suppressions require C++.
$CXX $OBJ $LDFLAGS -o $EXE
RES=$(LD_LIBRARY_PATH=$LLDB TSAN_OPTIONS="atexit_sleep_ms=0" $EXE 2>&1 || true)
$COMPILER $OBJ $LDFLAGS -o $EXE
RES=$(TSAN_OPTIONS="atexit_sleep_ms=0" $EXE 2>&1 || true)
if [ "$3" != "" ]; then
printf "%s\n" "$RES"
fi
@ -45,7 +41,7 @@ if [ "$1" == "" ]; then
case $c in
*.c) COMPILER=$CC
esac
test_file $c $COMPILER &
test_file $c $COMPILER
done
wait
else