[m-dev.] diff: test_mercury: test `--target asm'

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Mar 1 23:18:10 AEDT 2001


Note that the tests of `--target asm' don't actually *pass* yet;
fixing that will require more work ;-)

The two outstanding problems that I know of are
(1) nested modules don't work
(2) `mmake --target asm libfoo.install' doesn't work

----------

Estimated hours taken: 1

tools/test_mercury:
	- Add code for testing with `--target asm'.

Workspace: /home/mercury/public/test_mercury/scripts/mercury
Index: tools/test_mercury
===================================================================
RCS file: /home/staff/zs/imp/mercury/tools/test_mercury,v
retrieving revision 1.141
diff -u -d -r1.141 test_mercury
--- tools/test_mercury	2001/03/01 11:59:18	1.141
+++ tools/test_mercury	2001/03/01 12:15:06
@@ -311,6 +311,17 @@
 			hlc.gc.prof hlc.gc.memprof hlc.gc.tr hlc.par.gc \
 			hl.gc.prof  hl.gc.memprof  hl.gc.tr  hl.par.gc"
 		;;
+	hg)
+		CONFIG_OPTS=""
+		case $C_COMPILER in asm)
+			INSTALL_GRADE="hlc.gc"
+			INSTALL_LIBGRADES="asm_fast.gc asm_fast \
+				asm_fast.gc.prof asm_fast.prof  \
+				asm_fast.gc.memprof asm_fast.gc.tr \
+				asm_fast.gc.tr.debug hlc.par.gc"
+			;;
+		esac
+		;;
 	*)	
 		CONFIG_OPTS="" ;;
 esac
@@ -426,18 +437,33 @@
 	esac
 # fi
 
+# We allow "asm" as a special value for the C_COMPILER
+# variable; it means to build with `--target asm'.
+# $CC holds the name of the real C compiler.
+
+case $C_COMPILER in
+	asm)
+		CC=gcc
+		target_opts="--target asm"
+		;;
+	*)
+		CC="$C_COMPILER"
+		target_opts=""
+		;;
+esac
+export CC
+
 autoconf || { false; exit 1; }
 rm -f config.cache
-CC=$C_COMPILER
-export CC
 ./configure --prefix=$INSTALL_DIR $CONFIG_OPTS || { false; exit 1; }
-mmake depend $PARALLEL || { false; exit 1; }
-mmake realclean MMAKEFLAGS=$PARALLEL || { false; exit 1; }
+mmake $target_opts depend $PARALLEL || { false; exit 1; }
+mmake $target_opts realclean MMAKEFLAGS=$PARALLEL || { false; exit 1; }
 ./configure --prefix=$INSTALL_DIR $CONFIG_OPTS || { false; exit 1; }
-mmake depend $PARALLEL || { false; exit 1; }
-version=`mmake version` || { false; exit 1; }
-fullarch=`mmake fullarch` || { false; exit 1; }
-tools/bootcheck -k -r -p -t $PARALLEL || $install_anyway || { false; exit 1; }
+mmake $target_opts depend $PARALLEL || { false; exit 1; }
+version=`mmake $target_opts version` || { false; exit 1; }
+fullarch=`mmake $target_opts fullarch` || { false; exit 1; }
+tools/bootcheck $target_opts -k -r -p -t $PARALLEL ||
+	$install_anyway || { false; exit 1; }
 cd .. || { false; exit 1; }
 
 #-----------------------------------------------------------------------------#
@@ -471,13 +497,17 @@
     # again, look back in the CVS archives for version 1.114 to see
     # the necessary code.
 
-    mmake install MMAKEFLAGS=$PARALLEL || status=1
+    # Note that we don't pass $target_opts when doing `mmake install_grades';
+    # that wouldn't work, since many of the grades can only be built with
+    # `--target c'.
+    mmake $target_opts install_main MMAKEFLAGS=$PARALLEL || status=1
+    mmake install_grades MMAKEFLAGS=$PARALLEL || status=1
     case "$INSTALL_GRADE" in
 	hl*)
 	    	# --split-c-files is not supported for the hl* grades
 	    	;;
-	*)	mmake install_split_library LIBGRADES= MMAKEFLAGS=$PARALLEL ||
-	    		status=1
+	*)	mmake install_split_library \
+			LIBGRADES= MMAKEFLAGS=$PARALLEL || status=1
 		;;
     esac
 
@@ -636,7 +666,8 @@
 	hg)
 		GRADES="asm_fast.gc asm_fast
 			asm_fast.gc.prof asm_fast.prof
-			asm_fast.gc.memprof asm_fast.gc.tr asm_fast.gc.tr.debug
+			asm_fast.gc.memprof asm_fast.gc.tr
+			asm_fast.gc.tr.debug
 			asm_fast.par.gc hlc.gc"
 		;;
 
@@ -650,7 +681,8 @@
 		case $C_COMPILER in
 			gcc)	GRADES="asm_fast.gc asm_fast
 				asm_fast.gc.prof asm_fast.prof
-				asm_fast.gc.memprof asm_fast.gc.tr asm_fast.gc.tr.debug
+				asm_fast.gc.memprof asm_fast.gc.tr
+				asm_fast.gc.tr.debug
 				hlc.gc hlc.par.gc" ;;
 			*)	GRADES="none.gc none none.gc.prof
 				none.prof none.gc.memprof none.gc.tr
@@ -693,7 +725,8 @@
 		$PARALLEL || status=1
 	case $grade in
 		*.memprof*)
-			# we need to set LD_BIND_NOW=1 for profiling on DEC Alpha
+			# we need to set LD_BIND_NOW=1
+			# for profiling on DEC Alpha
 			(cd benchmarks &&
 			touch poly.m &&
 			mmake poly.depend &&
@@ -726,6 +759,16 @@
 			;;
 	esac
 done
+case $HOST in hg)
+	echo "test_mercury starting tests for --target asm at `date`" 1>&2
+	# XXX Note that some of these tests are currently expected to fail
+	# with `--target asm' (in particular the tests of tabling and
+	# nested modules), so we don't set status=1 if these tests fail.
+	./runtests --target asm -f "$TEST_MCFLAGS" -c "$TEST_CFLAGS" \
+		-g hlc.gc -m "$TEST_MGNUCFLAGS" -l "$TEST_MLFLAGS" \
+		$PARALLEL
+	;;
+esac
 cd ..
 
 #-----------------------------------------------------------------------------#

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list