2018-03-19 16:26:08 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2018-09-26 13:23:50 +00:00
|
|
|
usage() {
|
|
|
|
echo "usage: `basename $0` [OPTIONS]"
|
2019-03-26 13:06:13 +00:00
|
|
|
echo " --threads NUM The number of threads to use for running tests."
|
|
|
|
echo " --multilib-arch ARCH Use this option to test 32-bit libs/binaries on"
|
|
|
|
echo " 64-bit hosts."
|
2018-09-26 13:23:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
threads_arg=''
|
2018-03-19 16:26:08 +00:00
|
|
|
|
2018-09-26 13:23:50 +00:00
|
|
|
while [ $# -gt 0 ]; do
|
|
|
|
case $1 in
|
|
|
|
--threads)
|
|
|
|
shift
|
|
|
|
threads_arg="--threads $1"
|
|
|
|
;;
|
2019-03-26 13:06:13 +00:00
|
|
|
--multilib-arch)
|
|
|
|
shift
|
|
|
|
ARCH=$1
|
|
|
|
;;
|
2018-09-26 13:23:50 +00:00
|
|
|
* )
|
|
|
|
echo "unknown option: $1"
|
|
|
|
echo ""
|
|
|
|
usage
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
|
|
|
|
set -xe
|
2018-03-19 16:26:08 +00:00
|
|
|
|
2019-03-26 13:06:13 +00:00
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
ARCH=`rpm --eval '%_arch'`
|
|
|
|
fi
|
|
|
|
|
|
|
|
case $ARCH in
|
|
|
|
arm)
|
|
|
|
;&
|
|
|
|
i686)
|
|
|
|
LIB_DIR="/usr/lib/"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
LIB_DIR="/usr/lib64/"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2021-03-02 10:37:09 +00:00
|
|
|
cd $(mktemp -d)
|
2018-09-26 13:23:50 +00:00
|
|
|
ln -s /usr/include include
|
2020-08-19 14:39:12 +00:00
|
|
|
ln -s /usr/share/llvm/src/docs docs
|
2018-03-19 16:26:08 +00:00
|
|
|
tar -xzf /usr/share/llvm/src/test.tar.gz
|
2020-06-11 12:17:27 +00:00
|
|
|
ln -s /usr/share/llvm/src/$ARCH.site.cfg.py test/lit.site.cfg.py
|
|
|
|
ln -s /usr/share/llvm/src/$ARCH.Unit.site.cfg.py test/Unit/lit.site.cfg.py
|
2019-03-26 13:06:13 +00:00
|
|
|
lit -v -s $threads_arg test \
|
|
|
|
-Dllvm_obj_root=`pwd` \
|
|
|
|
-Dllvm_test_root=`pwd`/test \
|
|
|
|
-Dllvm_unittest_bindir=$LIB_DIR/llvm \
|
|
|
|
-Dllvm_shlib_dir=$LIB_DIR
|