OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc2/] [gcc/] [testsuite/] [ada/] [acats/] [run_all.sh] - Diff between revs 294 and 384

Only display areas with differences | Details | Blame | View Log

Rev 294 Rev 384
#!/bin/sh
#!/bin/sh
# Run ACATS with the GNU Ada compiler
# Run ACATS with the GNU Ada compiler
 
 
# The following functions are to be customized if you run in cross
# The following functions are to be customized if you run in cross
# environment or want to change compilation flags.  Note that for
# environment or want to change compilation flags.  Note that for
# tests requiring checks not turned on by default, this script
# tests requiring checks not turned on by default, this script
# automatically adds the needed flags to pass (ie: -gnato or -gnatE).
# automatically adds the needed flags to pass (ie: -gnato or -gnatE).
 
 
# gccflags="-O3 -fomit-frame-pointer -funroll-all-loops -finline-functions"
# gccflags="-O3 -fomit-frame-pointer -funroll-all-loops -finline-functions"
# gnatflags="-gnatN"
# gnatflags="-gnatN"
 
 
gccflags="-O2"
gccflags="-O2"
gnatflags="-gnatws"
gnatflags="-gnatws"
 
 
target_run () {
target_run () {
  eval $EXPECT -f $testdir/run_test.exp $*
  eval $EXPECT -f $testdir/run_test.exp $*
}
}
 
 
# End of customization section.
# End of customization section.
 
 
display_noeol () {
display_noeol () {
  printf "$@"
  printf "$@"
  printf "$@" >> $dir/acats.sum
  printf "$@" >> $dir/acats.sum
  printf "$@" >> $dir/acats.log
  printf "$@" >> $dir/acats.log
}
}
 
 
display () {
display () {
  echo "$@"
  echo "$@"
  echo "$@" >> $dir/acats.sum
  echo "$@" >> $dir/acats.sum
  echo "$@" >> $dir/acats.log
  echo "$@" >> $dir/acats.log
}
}
 
 
log () {
log () {
  echo "$@" >> $dir/acats.sum
  echo "$@" >> $dir/acats.sum
  echo "$@" >> $dir/acats.log
  echo "$@" >> $dir/acats.log
}
}
 
 
dir=`${PWDCMD-pwd}`
dir=`${PWDCMD-pwd}`
 
 
if [ "$testdir" = "" ]; then
if [ "$testdir" = "" ]; then
   echo You must use make check or make check-ada
   echo You must use make check or make check-ada
   exit 1
   exit 1
fi
fi
 
 
if [ "$dir" = "$testdir" ]; then
if [ "$dir" = "$testdir" ]; then
  echo "error: srcdir must be different than objdir, exiting."
  echo "error: srcdir must be different than objdir, exiting."
  exit 1
  exit 1
fi
fi
 
 
target_gnatchop () {
target_gnatchop () {
  gnatchop --GCC="$GCC_DRIVER" $*
  gnatchop --GCC="$GCC_DRIVER" $*
}
}
 
 
target_gnatmake () {
target_gnatmake () {
  echo gnatmake --GCC=\"$GCC\" $gnatflags $gccflags $* -largs $EXTERNAL_OBJECTS --GCC=\"$GCC\"
  echo gnatmake --GCC=\"$GCC\" $gnatflags $gccflags $* -largs $EXTERNAL_OBJECTS --GCC=\"$GCC\"
  gnatmake --GCC="$GCC" $gnatflags $gccflags $* -largs $EXTERNAL_OBJECTS --GCC="$GCC"
  gnatmake --GCC="$GCC" $gnatflags $gccflags $* -largs $EXTERNAL_OBJECTS --GCC="$GCC"
}
}
 
 
target_gcc () {
target_gcc () {
  $GCC $gccflags $*
  $GCC $gccflags $*
}
}
 
 
clean_dir () {
clean_dir () {
  rm -f "$binmain" *.o *.ali > /dev/null 2>&1
  rm -f "$binmain" *.o *.ali > /dev/null 2>&1
}
}
 
 
find_main () {
find_main () {
  ls ${i}?.adb > ${i}.lst 2> /dev/null
  ls ${i}?.adb > ${i}.lst 2> /dev/null
  ls ${i}*m.adb >> ${i}.lst 2> /dev/null
  ls ${i}*m.adb >> ${i}.lst 2> /dev/null
  ls ${i}.adb >> ${i}.lst 2> /dev/null
  ls ${i}.adb >> ${i}.lst 2> /dev/null
  main=`tail -1 ${i}.lst`
  main=`tail -1 ${i}.lst`
}
}
 
 
EXTERNAL_OBJECTS=""
EXTERNAL_OBJECTS=""
# Global variable to communicate external objects to link with.
# Global variable to communicate external objects to link with.
 
 
rm -f $dir/acats.sum $dir/acats.log
rm -f $dir/acats.sum $dir/acats.log
 
 
display "Test Run By $USER on `date`"
display "Test Run By $USER on `date`"
 
 
display "               === acats configuration ==="
display "               === acats configuration ==="
 
 
target=`$GCC -dumpmachine`
target=`$GCC -dumpmachine`
 
 
display target gcc is $GCC
display target gcc is $GCC
display `$GCC -v 2>&1`
display `$GCC -v 2>&1`
display host=`gcc -dumpmachine`
display host=`gcc -dumpmachine`
display target=$target
display target=$target
display `type gnatmake`
display `type gnatmake`
gnatls -v >> $dir/acats.log
gnatls -v >> $dir/acats.log
display ""
display ""
 
 
display "               === acats support ==="
display "               === acats support ==="
display_noeol "Generating support files..."
display_noeol "Generating support files..."
 
 
rm -rf $dir/support
rm -rf $dir/support
mkdir -p $dir/support
mkdir -p $dir/support
cd $dir/support
cd $dir/support
 
 
cp $testdir/support/*.ada $testdir/support/*.a $testdir/support/*.tst $dir/support
cp $testdir/support/*.ada $testdir/support/*.a $testdir/support/*.tst $dir/support
 
 
# Find out the size in bit of an address on the target
# Find out the size in bit of an address on the target
target_gnatmake $testdir/support/impbit.adb >> $dir/acats.log 2>&1
target_gnatmake $testdir/support/impbit.adb >> $dir/acats.log 2>&1
target_run $dir/support/impbit > $dir/support/impbit.out 2>&1
target_run $dir/support/impbit > $dir/support/impbit.out 2>&1
target_bit=`cat $dir/support/impbit.out`
target_bit=`cat $dir/support/impbit.out`
echo target_bit="$target_bit" >> $dir/acats.log
echo target_bit="$target_bit" >> $dir/acats.log
 
 
# Find out a suitable asm statement
# Find out a suitable asm statement
# Adapted from configure.ac gcc_cv_as_dwarf2_debug_line
# Adapted from configure.ac gcc_cv_as_dwarf2_debug_line
case "$target" in
case "$target" in
  ia64*-*-* | s390*-*-*)
  ia64*-*-* | s390*-*-*)
    target_insn="nop 0"
    target_insn="nop 0"
    ;;
    ;;
  mmix-*-*)
  mmix-*-*)
    target_insn="swym 0"
    target_insn="swym 0"
    ;;
    ;;
  *)
  *)
    target_insn="nop"
    target_insn="nop"
    ;;
    ;;
esac
esac
echo target_insn="$target_insn" >> $dir/acats.log
echo target_insn="$target_insn" >> $dir/acats.log
 
 
sed -e "s,ACATS4GNATDIR,$dir,g" \
sed -e "s,ACATS4GNATDIR,$dir,g" \
  < $testdir/support/impdef.a > $dir/support/impdef.a
  < $testdir/support/impdef.a > $dir/support/impdef.a
sed -e "s,ACATS4GNATDIR,$dir,g" \
sed -e "s,ACATS4GNATDIR,$dir,g" \
  -e "s,ACATS4GNATBIT,$target_bit,g" \
  -e "s,ACATS4GNATBIT,$target_bit,g" \
  -e "s,ACATS4GNATINSN,$target_insn,g" \
  -e "s,ACATS4GNATINSN,$target_insn,g" \
  < $testdir/support/macro.dfs > $dir/support/MACRO.DFS
  < $testdir/support/macro.dfs > $dir/support/MACRO.DFS
sed -e "s,ACATS4GNATDIR,$dir,g" \
sed -e "s,ACATS4GNATDIR,$dir,g" \
  < $testdir/support/tsttests.dat > $dir/support/TSTTESTS.DAT
  < $testdir/support/tsttests.dat > $dir/support/TSTTESTS.DAT
 
 
cp $testdir/tests/cd/*.c $dir/support
cp $testdir/tests/cd/*.c $dir/support
cp $testdir/tests/cxb/*.c $dir/support
cp $testdir/tests/cxb/*.c $dir/support
grep -v '^#' $testdir/norun.lst | sort > $dir/support/norun.lst
grep -v '^#' $testdir/norun.lst | sort > $dir/support/norun.lst
 
 
rm -rf $dir/run
rm -rf $dir/run
mv $dir/tests $dir/tests.$$ 2> /dev/null
mv $dir/tests $dir/tests.$$ 2> /dev/null
rm -rf $dir/tests.$$ &
rm -rf $dir/tests.$$ &
mkdir -p $dir/run
mkdir -p $dir/run
 
 
cp -pr $testdir/tests $dir/
cp -pr $testdir/tests $dir/
 
 
for i in $dir/support/*.ada $dir/support/*.a; do
for i in $dir/support/*.ada $dir/support/*.a; do
   host_gnatchop $i >> $dir/acats.log 2>&1
   host_gnatchop $i >> $dir/acats.log 2>&1
done
done
 
 
# These tools are used to preprocess some ACATS sources
# These tools are used to preprocess some ACATS sources
# they need to be compiled native on the host.
# they need to be compiled native on the host.
 
 
host_gnatmake -q -gnatws macrosub.adb
host_gnatmake -q -gnatws macrosub.adb
if [ $? -ne 0 ]; then
if [ $? -ne 0 ]; then
   display "**** Failed to compile macrosub"
   display "**** Failed to compile macrosub"
   exit 1
   exit 1
fi
fi
./macrosub > macrosub.out 2>&1
./macrosub > macrosub.out 2>&1
 
 
gcc -c cd300051.c
gcc -c cd300051.c
host_gnatmake -q -gnatws widechr.adb
host_gnatmake -q -gnatws widechr.adb
if [ $? -ne 0 ]; then
if [ $? -ne 0 ]; then
   display "**** Failed to compile widechr"
   display "**** Failed to compile widechr"
   exit 1
   exit 1
fi
fi
./widechr > widechr.out 2>&1
./widechr > widechr.out 2>&1
 
 
rm -f $dir/support/macrosub
rm -f $dir/support/macrosub
rm -f $dir/support/widechr
rm -f $dir/support/widechr
rm -f $dir/support/*.ali
rm -f $dir/support/*.ali
rm -f $dir/support/*.o
rm -f $dir/support/*.o
 
 
display " done."
display " done."
 
 
# From here, all compilations will be made by the target compiler
# From here, all compilations will be made by the target compiler
 
 
display_noeol "Compiling support files..."
display_noeol "Compiling support files..."
 
 
target_gcc -c *.c
target_gcc -c *.c
if [ $? -ne 0 ]; then
if [ $? -ne 0 ]; then
   display "**** Failed to compile C code"
   display "**** Failed to compile C code"
   exit 1
   exit 1
fi
fi
 
 
target_gnatchop *.adt >> $dir/acats.log 2>&1
target_gnatchop *.adt >> $dir/acats.log 2>&1
 
 
target_gnatmake -c -gnato -gnatE *.ads >> $dir/acats.log 2>&1
target_gnatmake -c -gnato -gnatE *.ads >> $dir/acats.log 2>&1
target_gnatmake -c -gnato -gnatE *.adb >> $dir/acats.log 2>&1
target_gnatmake -c -gnato -gnatE *.adb >> $dir/acats.log 2>&1
 
 
display " done."
display " done."
display ""
display ""
display "               === acats tests ==="
display "               === acats tests ==="
 
 
if [ $# -eq 0 ]; then
if [ $# -eq 0 ]; then
   chapters=`cd $dir/tests; echo [a-z]*`
   chapters=`cd $dir/tests; echo [a-z]*`
else
else
   chapters=$*
   chapters=$*
fi
fi
 
 
glob_countn=0
glob_countn=0
glob_countok=0
glob_countok=0
glob_countu=0
glob_countu=0
 
 
for chapter in $chapters; do
for chapter in $chapters; do
   display Running chapter $chapter ...
   display Running chapter $chapter ...
 
 
   if [ ! -d $dir/tests/$chapter ]; then
   if [ ! -d $dir/tests/$chapter ]; then
      display "*** CHAPTER $chapter does not exist, skipping."
      display "*** CHAPTER $chapter does not exist, skipping."
      display ""
      display ""
      continue
      continue
   fi
   fi
 
 
   cd $dir/tests/$chapter
   cd $dir/tests/$chapter
   ls *.a *.ada *.adt *.am *.dep 2> /dev/null | sed -e 's/\(.*\)\..*/\1/g' | \
   ls *.a *.ada *.adt *.am *.dep 2> /dev/null | sed -e 's/\(.*\)\..*/\1/g' | \
   cut -c1-7 | sort | uniq | comm -23 - $dir/support/norun.lst \
   cut -c1-7 | sort | uniq | comm -23 - $dir/support/norun.lst \
     > $dir/tests/$chapter/${chapter}.lst
     > $dir/tests/$chapter/${chapter}.lst
   countn=`wc -l < $dir/tests/$chapter/${chapter}.lst`
   countn=`wc -l < $dir/tests/$chapter/${chapter}.lst`
   glob_countn=`expr $glob_countn + $countn`
   glob_countn=`expr $glob_countn + $countn`
   counti=0
   counti=0
   for i in `cat $dir/tests/$chapter/${chapter}.lst`; do
   for i in `cat $dir/tests/$chapter/${chapter}.lst`; do
      counti=`expr $counti + 1`
      counti=`expr $counti + 1`
      extraflags=""
      extraflags=""
      grep $i $testdir/overflow.lst > /dev/null 2>&1
      grep $i $testdir/overflow.lst > /dev/null 2>&1
      if [ $? -eq 0 ]; then
      if [ $? -eq 0 ]; then
         extraflags="$extraflags -gnato"
         extraflags="$extraflags -gnato"
      fi
      fi
      grep $i $testdir/elabd.lst > /dev/null 2>&1
      grep $i $testdir/elabd.lst > /dev/null 2>&1
      if [ $? -eq 0 ]; then
      if [ $? -eq 0 ]; then
         extraflags="$extraflags -gnatE"
         extraflags="$extraflags -gnatE"
      fi
      fi
      grep $i $testdir/stackcheck.lst > /dev/null 2>&1
      grep $i $testdir/stackcheck.lst > /dev/null 2>&1
      if [ $? -eq 0 ]; then
      if [ $? -eq 0 ]; then
         extraflags="$extraflags -fstack-check"
         extraflags="$extraflags -fstack-check"
      fi
      fi
      grep $i $testdir/ada95.lst > /dev/null 2>&1
      grep $i $testdir/ada95.lst > /dev/null 2>&1
      if [ $? -eq 0 ]; then
      if [ $? -eq 0 ]; then
         extraflags="$extraflags -gnat95"
         extraflags="$extraflags -gnat95"
      fi
      fi
      test=$dir/tests/$chapter/$i
      test=$dir/tests/$chapter/$i
      mkdir $test && cd $test >> $dir/acats.log 2>&1
      mkdir $test && cd $test >> $dir/acats.log 2>&1
 
 
      if [ $? -ne 0 ]; then
      if [ $? -ne 0 ]; then
         display "FAIL: $i"
         display "FAIL: $i"
         failed="${failed}${i} "
         failed="${failed}${i} "
         clean_dir
         clean_dir
         continue
         continue
      fi
      fi
 
 
      target_gnatchop -c -w `ls ${test}*.a ${test}*.ada ${test}*.adt ${test}*.am ${test}*.dep 2> /dev/null` >> $dir/acats.log 2>&1
      target_gnatchop -c -w `ls ${test}*.a ${test}*.ada ${test}*.adt ${test}*.am ${test}*.dep 2> /dev/null` >> $dir/acats.log 2>&1
      main=""
      main=""
      find_main
      find_main
      if [ -z "$main" ]; then
      if [ -z "$main" ]; then
         sync
         sync
         find_main
         find_main
      fi
      fi
      binmain=`echo $main | sed -e 's/\(.*\)\..*/\1/g'`
      binmain=`echo $main | sed -e 's/\(.*\)\..*/\1/g'`
      echo "BUILD $main" >> $dir/acats.log
      echo "BUILD $main" >> $dir/acats.log
      EXTERNAL_OBJECTS=""
      EXTERNAL_OBJECTS=""
      case $i in
      case $i in
        cxb30*) EXTERNAL_OBJECTS="$dir/support/cxb30040.o $dir/support/cxb30060.o $dir/support/cxb30130.o $dir/support/cxb30131.o";;
        cxb30*) EXTERNAL_OBJECTS="$dir/support/cxb30040.o $dir/support/cxb30060.o $dir/support/cxb30130.o $dir/support/cxb30131.o";;
        ca1020e) rm -f ca1020e_func1.adb ca1020e_func2.adb ca1020e_proc1.adb ca1020e_proc2.adb > /dev/null 2>&1;;
        ca1020e) rm -f ca1020e_func1.adb ca1020e_func2.adb ca1020e_proc1.adb ca1020e_proc2.adb > /dev/null 2>&1;;
        ca14028) rm -f ca14028_func2.ads ca14028_func3.ads ca14028_proc1.ads ca14028_proc3.ads > /dev/null 2>&1;;
        ca14028) rm -f ca14028_func2.ads ca14028_func3.ads ca14028_proc1.ads ca14028_proc3.ads > /dev/null 2>&1;;
        cxh1001) extraflags="-a -f"; echo "pragma Normalize_Scalars;" > gnat.adc
        cxh1001) extraflags="-a -f"; echo "pragma Normalize_Scalars;" > gnat.adc
      esac
      esac
      if [ "$main" = "" ]; then
      if [ "$main" = "" ]; then
         display "FAIL: $i"
         display "FAIL: $i"
         failed="${failed}${i} "
         failed="${failed}${i} "
         clean_dir
         clean_dir
         continue
         continue
      fi
      fi
 
 
      target_gnatmake $extraflags -I$dir/support $main >> $dir/acats.log 2>&1
      target_gnatmake $extraflags -I$dir/support $main >> $dir/acats.log 2>&1
      if [ $? -ne 0 ]; then
      if [ $? -ne 0 ]; then
         display "FAIL: $i"
         display "FAIL: $i"
         failed="${failed}${i} "
         failed="${failed}${i} "
         clean_dir
         clean_dir
         continue
         continue
      fi
      fi
 
 
      echo "RUN $binmain" >> $dir/acats.log
      echo "RUN $binmain" >> $dir/acats.log
      cd $dir/run
      cd $dir/run
      if [ ! -x $dir/tests/$chapter/$i/$binmain ]; then
      if [ ! -x $dir/tests/$chapter/$i/$binmain ]; then
         sync
         sync
      fi
      fi
      target_run $dir/tests/$chapter/$i/$binmain > $dir/tests/$chapter/$i/${i}.log 2>&1
      target_run $dir/tests/$chapter/$i/$binmain > $dir/tests/$chapter/$i/${i}.log 2>&1
      cd $dir/tests/$chapter/$i
      cd $dir/tests/$chapter/$i
      cat ${i}.log >> $dir/acats.log
      cat ${i}.log >> $dir/acats.log
      egrep -e '(==== |\+\+\+\+ |\!\!\!\! )' ${i}.log > /dev/null 2>&1
      egrep -e '(==== |\+\+\+\+ |\!\!\!\! )' ${i}.log > /dev/null 2>&1
      if [ $? -ne 0 ]; then
      if [ $? -ne 0 ]; then
         grep 'tasking not implemented' ${i}.log > /dev/null 2>&1
         grep 'tasking not implemented' ${i}.log > /dev/null 2>&1
 
 
         if [ $? -ne 0 ]; then
         if [ $? -ne 0 ]; then
            display "FAIL:      $i"
            display "FAIL:      $i"
            failed="${failed}${i} "
            failed="${failed}${i} "
         else
         else
            log "UNSUPPORTED:   $i"
            log "UNSUPPORTED:   $i"
            glob_countn=`expr $glob_countn - 1`
            glob_countn=`expr $glob_countn - 1`
            glob_countu=`expr $glob_countu + 1`
            glob_countu=`expr $glob_countu + 1`
         fi
         fi
      else
      else
         log "PASS:     $i"
         log "PASS:     $i"
         glob_countok=`expr $glob_countok + 1`
         glob_countok=`expr $glob_countok + 1`
      fi
      fi
      clean_dir
      clean_dir
   done
   done
done
done
 
 
display "               === acats Summary ==="
display "               === acats Summary ==="
display "# of expected passes           $glob_countok"
display "# of expected passes           $glob_countok"
display "# of unexpected failures       `expr $glob_countn - $glob_countok`"
display "# of unexpected failures       `expr $glob_countn - $glob_countok`"
 
 
if [ $glob_countu -ne 0 ]; then
if [ $glob_countu -ne 0 ]; then
   display "# of unsupported tests              $glob_countu"
   display "# of unsupported tests              $glob_countu"
fi
fi
 
 
if [ $glob_countok -ne $glob_countn ]; then
if [ $glob_countok -ne $glob_countn ]; then
   display "*** FAILURES: $failed"
   display "*** FAILURES: $failed"
fi
fi
 
 
display "$0 completed at `date`"
display "$0 completed at `date`"
 
 
exit 0
exit 0
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.