llvm.org GIT mirror llvm / 2232a80
Allow the input of the test program to be specified. Don't generate the reference output for each comparison. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32395 91177308-0d34-0410-b5e6-96231b3b80d8 Reid Spencer 13 years ago
1 changed file(s) with 11 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
2525 # is a directory into which intermediate results are placed
2626 # progargs
2727 # is a single argument containing all the arguments the program needs
28 # proginput
29 # is a file name from which stdin should be directed
2830 # match
2931 # if specified to any value causes the result code of the program to
3032 # be used to determine success/fail. If not specified success/fail is
4951 bcfile="$1"
5052 outdir="$2"
5153 args="$3"
52 match="$4"
54 input="$4"
55 if [ ! -f "$input" ] ; then
56 input="/dev/null"
57 fi
58 match="$5"
5359 name=`basename $bcfile .bc`
5460 ll="$outdir/${name}.ll"
5561 s="$outdir/${name}.s"
7985 # Generate the disassembly
8086 llvm-dis "$bcfile" -o "$ll" -f || exit 1
8187
82 # Generate the non-optimized program
88 # Generate the non-optimized program and its output
8389 llc "$bcfile" -o "$s" -f || exit 1
8490 gcc "$s" -o "$prog" $ldflags || exit 1
91 "$prog" $args > "$out" 2>&1 <$input
92 ex1=$?
8593
8694 # Define the list of optimizations to run. This comprises the same set of
8795 # optimizations that gccas and gccld run, in the same order.
97105 llvm-dis "$optbc" -o "$optll" -f || exit
98106 llc "$optbc" -o "$opts" -f || exit
99107 gcc "$opts" -o "$optprog" $ldflags || exit
100 "$prog" $args > "$out" 2>&1
101 ex1=$?
102 "$optprog" $args > "$optout" 2>&1
108 "$optprog" $args > "$optout" 2>&1 <"$input"
103109 ex2=$?
104110
105111 if [ -n "$match" ] ; then