Unlike the gnat.dg testsuite, the ACATS testsuite doesn't use the newly built
gnatmake/gnatbind/gnatlink tools, which is rather inconsistent.
Fixed thusly, tested on x86_64-suse-linux, applied on the mainline.
2016-04-30 Eric Botcazou <ebotca...@adacore.com>
* gcc-interface/Make-lang.in (ACATSCMD): New variable.
(check-acats): Use it.
(check_acats_targets): Likewise.
2016-04-30 Eric Botcazou <ebotca...@adacore.com>
* ada/acats/run_acats: Rename into...
* ada/acats/run_acats.sh: ...this. Only export BASE variable.
* ada/acats/run_all.sh: Remove redundant test.
(target_run): Move around.
(target_gnatchop): Use newly built executable.
(target_gnatmake): Likewise.
Check that the compilation of impbit succeeds.
--
Eric Botcazou
Index: ada/gcc-interface/Make-lang.in
===================================================================
--- ada/gcc-interface/Make-lang.in (revision 235619)
+++ ada/gcc-interface/Make-lang.in (working copy)
@@ -868,6 +868,7 @@ check-ada: check-acats check-gnat
check-ada-subtargets: check-acats-subtargets check-gnat-subtargets
ACATSDIR = $(TESTSUITEDIR)/ada/acats
+ACATSCMD = run_acats.sh
check_acats_numbers0:=1 2 3 4 5 6 7 8 9
check_acats_numbers1:=0 $(check_acats_numbers0)
@@ -892,7 +893,7 @@ check-acats:
mkdir $(ACATSDIR)-parallel; \
( testdir=`cd ${srcdir}/${ACATSDIR} && ${PWD_COMMAND}`; \
export testdir; \
- cd $(ACATSDIR) && $(SHELL) $${testdir}/run_acats NONE ) \
+ cd $(ACATSDIR) && $(SHELL) $${testdir}/$(ACATSCMD) NONE ) \
|| exit 1; \
GCC_RUNTEST_PARALLELIZE_DIR=$$rootme/$(ACATSDIR)-parallel; \
export GCC_RUNTEST_PARALLELIZE_DIR; \
@@ -913,7 +914,7 @@ check-acats:
exit 0; \
fi; \
testdir=`cd ${srcdir}/${ACATSDIR} && ${PWD_COMMAND}`; \
- export testdir; cd $(ACATSDIR) && $(SHELL) $${testdir}/run_acats $(CHAPTERS)
+ export testdir; cd $(ACATSDIR) && $(SHELL) $${testdir}/$(ACATSCMD) $(CHAPTERS)
check-acats-subtargets:
@echo check-acats
@@ -925,7 +926,7 @@ $(check_acats_targets): check-acats%:
fi; \
test -d $(ACATSDIR)$* || mkdir -p $(ACATSDIR)$*; \
testdir=`cd ${srcdir}/${ACATSDIR} && ${PWD_COMMAND}`; \
- export testdir; cd $(ACATSDIR)$* && $(SHELL) $${testdir}/run_acats
+ export testdir; cd $(ACATSDIR)$* && $(SHELL) $${testdir}/$(ACATSCMD)
touch $$GCC_RUNTEST_PARALLELIZE_DIR/finished
.PHONY: check-acats $(check_acats_targets)
Index: testsuite/ada/acats/run_acats
===================================================================
--- testsuite/ada/acats/run_acats (revision 235619)
+++ testsuite/ada/acats/run_acats (working copy)
@@ -1,73 +0,0 @@
-#!/bin/sh
-
-if [ "$testdir" = "" ]; then
- echo You must use make check or make check-ada
- exit 1
-fi
-
-# Provide which replacement.
-#
-# type -p is missing from Solaris 2 /bin/sh and /bin/ksh (ksh88), but both
-# ksh93 and bash have it.
-# type output format differs between ksh88 and ksh93, so avoid it if
-# type -p is present. Unfortunately, HP-UX /bin/sh ignores -p with type.
-# Fall back to whence which ksh88 and ksh93 provide, but bash does not.
-
-which () {
- path=`type -p $* 2>/dev/null` && { echo $path | awk '{print $NF}'; return 0; }
- path=`type $* 2>/dev/null` && { echo $path | awk '{print $NF}'; return 0; }
- path=`whence $* 2>/dev/null` && { echo $path; return 0; }
- return 1
-}
-
-# Set up environment to use the Ada compiler from the object tree
-
-host_gnatchop=`which gnatchop`
-host_gnatmake=`which gnatmake`
-ROOT=`${PWDCMD-pwd}`
-BASE=`cd $ROOT/../../..; ${PWDCMD-pwd}`
-
-PATH=$BASE:$ROOT:$PATH
-ADA_INCLUDE_PATH=$BASE/ada/rts
-LD_LIBRARY_PATH=$ADA_INCLUDE_PATH:$BASE:$LD_LIBRARY_PATH
-ADA_OBJECTS_PATH=$ADA_INCLUDE_PATH
-
-if [ ! -d $ADA_INCLUDE_PATH ]; then
- echo gnatlib missing, exiting.
- exit 1
-fi
-
-if [ ! -f $BASE/gnatchop ]; then
- echo gnattools missing, exiting.
- exit 1
-fi
-
-if [ ! -f $BASE/gnatmake ]; then
- echo gnattools missing, exiting.
- exit 1
-fi
-
-GCC_DRIVER="$BASE/xgcc"
-GCC="$BASE/xgcc -B$BASE/"
-export PATH ADA_INCLUDE_PATH ADA_OBJECTS_PATH GCC_DRIVER GCC LD_LIBRARY_PATH
-
-echo '#!/bin/sh' > host_gnatchop
-echo PATH=`dirname $host_gnatchop`:'$PATH' >> host_gnatchop
-echo unset ADA_INCLUDE_PATH ADA_OBJECTS_PATH GCC_EXEC_PREFIX >> host_gnatchop
-echo export PATH >> host_gnatchop
-echo exec gnatchop '"$@"' >> host_gnatchop
-
-chmod +x host_gnatchop
-
-echo '#!/bin/sh' > host_gnatmake
-echo PATH=`dirname $host_gnatmake`:'$PATH' >> host_gnatmake
-echo unset ADA_INCLUDE_PATH ADA_OBJECTS_PATH GCC_EXEC_PREFIX >> host_gnatmake
-echo export PATH >> host_gnatmake
-echo exec gnatmake '"$@"' >> host_gnatmake
-
-chmod +x host_gnatmake
-
-# Limit the stack to 16MB for stack checking
-ulimit -s 16384
-
-exec $testdir/run_all.sh ${1+"$@"}
Index: testsuite/ada/acats/run_acats.sh
===================================================================
--- testsuite/ada/acats/run_acats.sh (revision 235619)
+++ testsuite/ada/acats/run_acats.sh (working copy)
@@ -47,9 +47,7 @@ if [ ! -f $BASE/gnatmake ]; then
exit 1
fi
-GCC_DRIVER="$BASE/xgcc"
-GCC="$BASE/xgcc -B$BASE/"
-export PATH ADA_INCLUDE_PATH ADA_OBJECTS_PATH GCC_DRIVER GCC LD_LIBRARY_PATH
+export PATH ADA_INCLUDE_PATH ADA_OBJECTS_PATH BASE LD_LIBRARY_PATH
echo '#!/bin/sh' > host_gnatchop
echo PATH=`dirname $host_gnatchop`:'$PATH' >> host_gnatchop
Index: testsuite/ada/acats/run_all.sh
===================================================================
--- testsuite/ada/acats/run_all.sh (revision 235619)
+++ testsuite/ada/acats/run_all.sh (working copy)
@@ -12,10 +12,6 @@
gccflags="-O2"
gnatflags="-gnatws"
-target_run () {
- eval $EXPECT -f $testdir/run_test.exp $*
-}
-
# End of customization section.
# Perform arithmetic evaluation on the ARGs, and store the result in the
@@ -52,29 +48,30 @@ log () {
dir=`${PWDCMD-pwd}`
-if [ "$testdir" = "" ]; then
- echo You must use make check or make check-ada
- exit 1
-fi
-
if [ "$dir" = "$testdir" ]; then
echo "error: srcdir must be different than objdir, exiting."
exit 1
fi
+GCC="$BASE/xgcc -B$BASE/"
+
target_gnatchop () {
- gnatchop --GCC="$GCC_DRIVER" $*
+ $BASE/gnatchop --GCC="$BASE/xgcc" $*
}
target_gnatmake () {
- echo gnatmake --GCC=\"$GCC\" $gnatflags $gccflags $* -largs $EXTERNAL_OBJECTS --GCC=\"$GCC\"
- gnatmake --GCC="$GCC" $gnatflags $gccflags $* -largs $EXTERNAL_OBJECTS --GCC="$GCC"
+ echo $BASE/gnatmake --GNATBIND=$BASE/gnatbind --GNATLINK=$BASE/gnatlink --GCC="$GCC" $gnatflags $gccflags $* -largs $EXTERNAL_OBJECTS --GCC="$GCC"
+ $BASE/gnatmake --GNATBIND=$BASE/gnatbind --GNATLINK=$BASE/gnatlink --GCC="$GCC" $gnatflags $gccflags $* -largs $EXTERNAL_OBJECTS --GCC="$GCC"
}
target_gcc () {
$GCC $gccflags $*
}
+target_run () {
+ eval $EXPECT -f $testdir/run_test.exp $*
+}
+
clean_dir () {
rm -f "$binmain" *.o *.ali > /dev/null 2>&1
}
@@ -128,6 +125,10 @@ cp $testdir/support/*.ada $testdir/suppo
# Find out the size in bit of an address on the target
target_gnatmake $testdir/support/impbit.adb >> $dir/acats.log 2>&1
+if [ $? -ne 0 ]; then
+ display "**** Failed to compile impbit"
+ exit 1
+fi
target_run $dir/support/impbit > $dir/support/impbit.out 2>&1
target_bit=`cat $dir/support/impbit.out`
echo target_bit="$target_bit" >> $dir/acats.log