[LoopReroll] Add an extra defensive check to avoid SCEV assertion.
[llvm-project.git] / flang / test / Semantics / common.sh
blob22cdc9bfb22e32cbaedd68345ec64d6398c8bf0b
1 # Common functionality for test scripts
2 # Process arguments, expecting source file as 1st; optional path to f18 as 2nd
3 # Set: $FLANG_FC1 to the path to the Flang frontend driver with options; $temp
4 # to an empty temp directory; and $src to the full path of the single source
5 # argument.
7 function die {
8 echo "$(basename $0): $*" >&2
9 exit 1
11 if [[ $# < 3 ]]; then
12 echo "Usage: $(basename $0) <fortran-source> <temp test dir> <f18-command>"
13 exit 1
16 case $1 in
17 (/*) src="$1" ;;
18 (*) src="$(dirname $0)/$1" ;;
19 esac
20 shift
21 temp=$1
22 mkdir -p $temp
23 shift
25 [[ ! -f $1 ]] && die "f18 executable not found: $1"
26 FLANG_FC1="$*"