240573
#!/bin/bash
240573
240573
usage() {
240573
    echo "usage: `basename $0` [OPTIONS]"
240573
    echo "  --threads NUM         The number of threads to use for running tests."
240573
    echo "  --multilib-arch ARCH  Use this option to test 32-bit libs/binaries on"
240573
    echo "                        64-bit hosts."
240573
}
240573
240573
threads_arg=''
240573
240573
while [ $# -gt 0 ]; do
240573
    case $1 in
240573
        --threads)
240573
            shift
240573
            threads_arg="--threads $1"
240573
            ;;
240573
	--multilib-arch)
240573
            shift
240573
	    ARCH=$1
240573
	    ;;
240573
        * )
240573
            echo "unknown option: $1"
240573
            echo ""
240573
            usage
240573
            exit 1
240573
            ;;
240573
    esac
240573
    shift
240573
done
240573
240573
set -xe
240573
240573
if [ -z "$ARCH" ]; then
240573
    ARCH=`rpm --eval '%_arch'`
240573
fi
240573
240573
case $ARCH in
240573
    arm)
240573
	;&
240573
    i686)
240573
        LIB_DIR="/usr/lib/"
240573
        ;;
240573
    *)
240573
        LIB_DIR="/usr/lib64/"
240573
        ;;
240573
esac
240573
240573
cd $(mktemp -d)
240573
ln -s /usr/include include
240573
tar -xzf /usr/share/llvm/src/test.tar.gz
915461
ln -s /usr/share/llvm/src/$ARCH.site.cfg.py test/lit.site.cfg.py
915461
ln -s /usr/share/llvm/src/$ARCH.Unit.site.cfg.py test/Unit/lit.site.cfg.py
709524
ln -s /usr/share/llvm/src/docs docs
709524
lit -v $threads_arg test \
915461
	-Dllvm_obj_root=`pwd` \
240573
	-Dllvm_test_root=`pwd`/test \
240573
	-Dllvm_unittest_bindir=$LIB_DIR/llvm \
240573
	-Dllvm_shlib_dir=$LIB_DIR