Make it possible to provide special (linker) flags for the thread tests.

Use it to build & link against libpthread on NetBSD for tests iff they
are testing the thread interface.

llvm-svn: 180942
This commit is contained in:
Joerg Sonnenberger 2013-05-02 19:21:36 +00:00
parent 95cae88bcf
commit 087e35ec03
1 changed files with 15 additions and 5 deletions

View File

@ -61,6 +61,12 @@ case $TRIPLE in
;;
esac
case $(uname -s) in
NetBSD)
THREAD_FLAGS=-lpthread
;;
esac
FAIL=0
PASS=0
UNIMPLEMENTED=0
@ -91,7 +97,7 @@ afunc() {
then
echo "Running test: " $FILE
fi
if $CC $OPTIONS $HEADER_INCLUDE $SOURCE_LIB $FILE $LIBS -o ./$TEST_EXE
if $CC $OPTIONS $HEADER_INCLUDE $SOURCE_LIB $FILE $LIBS $(test $1 = no || echo $THREAD_FLAGS) -o ./$TEST_EXE
then
if ./$TEST_EXE
then
@ -99,13 +105,13 @@ afunc() {
pass=$(($pass+1))
else
echo "`pwd`/$FILE failed at run time"
echo "Compile line was:" $CC $OPTIONS $HEADER_INCLUDE $SOURCE_LIB $FILE $LIBS
echo "Compile line was:" $CC $OPTIONS $HEADER_INCLUDE $SOURCE_LIB $FILE $LIBS $(test $1 = no || echo $THREAD_FLAGS)
fail=$(($fail+1))
rm ./$TEST_EXE
fi
else
echo "`pwd`/$FILE failed to compile"
echo "Compile line was:" $CC $OPTIONS $HEADER_INCLUDE $SOURCE_LIB $FILE $LIBS
echo "Compile line was:" $CC $OPTIONS $HEADER_INCLUDE $SOURCE_LIB $FILE $LIBS $(test $1 = no || echo $THREAD_FLAGS)
fail=$(($fail+1))
fi
done
@ -138,13 +144,17 @@ afunc() {
if [ -d "$FILE" ];
then
cd $FILE
afunc
if [ $FILE = thread -o $1 = yes ]; then
afunc yes
else
afunc no
fi
cd ..
fi
done
}
afunc
afunc no
echo "****************************************************"
echo "Results for `pwd`:"