[llvm-commits] CVS: reopt/test/DiffLLCOutput.sh TEST.reopt.Makefile

Brian Gaeke gaeke at cs.uiuc.edu
Thu Jan 8 11:22:01 PST 2004


Changes in directory reopt/test:

DiffLLCOutput.sh added (r1.1)
TEST.reopt.Makefile updated: 1.5 -> 1.6

---
Log message:

Actually diff test results against LLC's output instead of whatever
confusing things we were doing before.

DiffLLCOutput.sh is a version of DiffOutput.sh that lets you specify
which test result to diff against; it defaults to 'nat', as with the old
DiffOutput.sh.


---
Diffs of the changes:  (+56 -4)

Index: reopt/test/DiffLLCOutput.sh
diff -c /dev/null reopt/test/DiffLLCOutput.sh:1.1
*** /dev/null	Thu Jan  8 11:21:20 2004
--- reopt/test/DiffLLCOutput.sh	Thu Jan  8 11:21:09 2004
***************
*** 0 ****
--- 1,51 ----
+ #!/bin/sh
+ #
+ # NAME
+ #     DiffOutput.sh
+ #
+ # SYNOPSIS
+ #     DiffOutput.sh <testtype> <testname> [<diffagainst>]
+ #
+ # DESCRIPTION
+ #     DiffOutput.sh looks for a file named Output/<testname>.out-<testtype>
+ #     and uses GNU diff to compare it against the file
+ #     Output/<testname>.out-<diffagainst>.  This script is used to verify the
+ #     results of programs run in the LLVM test suite. <diffagainst> is "nat"
+ #     by default; that is, test results are compared with output from the
+ #     program compiled with the native compiler, by default.  If the files
+ #     differ, DiffOutput.sh prints a portion of the differences.
+ #
+ # EXIT STATUS
+ #     DiffOutput.sh always exits with a zero (successful) exit code.
+ #
+ 
+ # Command line parameters:
+ WHICHOUTPUT=$1
+ PROG=$2
+ DIFFAGAINST=${3-nat}
+ # Output filename:
+ TESTDIFFS=Output/${PROG}.diff-${WHICHOUTPUT}
+ # Input filenames:
+ TESTOUTPUT=Output/${PROG}.out-${WHICHOUTPUT}
+ DIFFAGAINST=Output/${PROG}.out-${DIFFAGAINST}
+ 
+ # Find gnu diff
+ DIFF=diff
+ if which gdiff > /dev/null 2>&1
+ then
+   where=`which gdiff 2>&1`
+   if [ -x "$where" ]
+   then
+     DIFF=gdiff
+   fi
+ fi
+ 
+ # Diff the two files.
+ $DIFF -u $DIFFAGAINST $TESTOUTPUT > $TESTDIFFS || (
+   # They are different!
+   echo "******************** TEST '$PROG' FAILED! ********************"
+   echo "Execution Context Diff:"
+   head -n 200 $TESTDIFFS | cat -v
+   rm $TESTDIFFS
+   echo "******************** TEST '$PROG' FAILED! ********************"
+ )


Index: reopt/test/TEST.reopt.Makefile
diff -u reopt/test/TEST.reopt.Makefile:1.5 reopt/test/TEST.reopt.Makefile:1.6
--- reopt/test/TEST.reopt.Makefile:1.5	Mon Nov 10 01:08:51 2003
+++ reopt/test/TEST.reopt.Makefile	Thu Jan  8 11:21:09 2004
@@ -13,6 +13,8 @@
 
 TESTNAME = $*
 
+PROJDIFFPROG = $(PROJECT_DIR)/test/DiffLLCOutput.sh
+
 REOPTLIBDIR = $(PROJECT_DIR)/lib/Debug
 
 # Libraries that contain the Reoptimizer itself
@@ -57,8 +59,8 @@
 $(PROGRAMS_TO_TEST:%=Output/%.reopt-llc.s): \
 Output/%.reopt-llc.s: Output/%.llvm.bc
 	@echo "===== Building Reoptimizer version of $(TESTNAME) ====="
-	-$(LOPT) -q -inline -lowerswitch -branch-combine -emitfuncs -instloops $< |\
-	$(LLC) $(LLCFLAGS) -disable-sched -disable-strip -f -enable-maps \
+	-$(LOPT) -q -inline -lowerswitch -branch-combine -emitfuncs -instloops \
+	$< | $(LLC) $(LLCFLAGS) -disable-sched -disable-strip -f -enable-maps \
 	-save-ra-state -o $@
 
 # 2. Link the instrumented binary with the necessary parts of the
@@ -76,5 +78,4 @@
 # 4. Diff it against the plain old llc version
 $(PROGRAMS_TO_TEST:%=Output/%.diff-reopt-llc): \
 Output/%.diff-reopt-llc: Output/%.out-llc Output/%.out-reopt-llc
-	-$(DIFFPROG) reopt-llc $* $(HIDEDIFF)
-
+	-$(PROJDIFFPROG) reopt-llc $* llc $(HIDEDIFF)





More information about the llvm-commits mailing list