URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [go.test/] [test/] [run] - Rev 700
Compare with Previous | Blame | View Log
#!/usr/bin/env bash# Copyright 2009 The Go Authors. All rights reserved.# Use of this source code is governed by a BSD-style# license that can be found in the LICENSE file.eval $(gomake --no-print-directory -f ../src/Make.inc go-env)export E=case X"$GOARCH" inXamd64)export A=6;;X386)export A=8;;Xarm)export A=5export E="$GORUN";;*)echo 1>&2 run: unsupported '$GOARCH'exit 1esacexport G="${A}g ${GCFLAGS}"export L=${A}lexport GOTRACEBACK=0export LANG=Cunset GREP_OPTIONS # in case user has a non-standard setfailed=0PATH=${GOBIN:-$GOROOT/bin}:`pwd`:/bin:/usr/bin:/usr/local/binRUNFILE="/tmp/gorun-$$-$USER"TMP1FILE="/tmp/gotest1-$$-$USER"TMP2FILE="/tmp/gotest2-$$-$USER"# don't run the machine out of memory: limit individual processes to 4GB.# on thresher, 3GB suffices to run the tests; with 2GB, peano fails.ulimit -v 4000000# no core files pleaseulimit -c 0true >pass.out >times.outexclude=false # exclude nothinggolden=golden.outfilterout() {grep '^'"$2"'$' $1 >/dev/null}for dir in . ken chan interface syntax dwarf fixedbugs bugsdoechoecho '==' $dir'/'for i in $(ls $dir/*.go 2>/dev/null)do (if $exclude $i; thenexit 0 # continues for loopfiexport F=$(basename $i .go)export D=$dirsed '/^\/\//!q' $i | sed 's@//@@; $d' |sed 's|./\$A.out|$E &|g' >"$RUNFILE"if ! { time -p bash -c "bash '$RUNFILE' >'$TMP1FILE' 2>&1" ; } 2>"$TMP2FILE"thenechoecho "===========" $icat "$TMP1FILE"echo >&2 fail: $iecho "# $i # fail" >>pass.outelif test -s "$TMP1FILE"thenechoecho "===========" $icat "$TMP1FILE"if grep -q '^BUG' "$TMP1FILE"thenif [ $dir != bugs ]thenecho >&2 bug: $ifiecho "# $i # fail, BUG" >>pass.outelseecho $i >>pass.outfielif [ $dir = "bugs" ]thenecho $i succeeded with no output.elseecho $i >>pass.outfiecho $(awk 'NR==1{print $2}' "$TMP2FILE") $D/$F >>times.outrm -f $F.$A $A.out) donedone | # clean up some stack noiseegrep -v '^(r[0-9a-z]+|[cfg]s) +0x' |sed '/tmp.*Bus error/s/.*Bus/Bus/; /tmp.*Trace.BPT/s/.*Trace/Trace/s!'"$RUNFILE"'!$RUNFILE!gs/^PC=0x[0-9a-f]*/pc: xxx/s/^pc: 0x[0-9a-f]*/pc: xxx/s/PC=0x[0-9a-f]*/PC=xxx//^Trace\/breakpoint trap/d/^Trace\/BPT trap/d/RUNFILE/ s/line 1: *[0-9]*/line 1: PID//^\$RUNFILE: line 1: PID Trace\/breakpoint trap/d/Segmentation fault/d/^qemu: uncaught target signal 11 (Segmentation fault) - exiting/d' > run.outrm -f "$RUNFILE" "$TMP1FILE" "$TMP2FILE" *.$A *.a $A.outdiffmsg=""if ! diff $golden run.outthendiffmsg="; test output differs"failed=1finotinbugs=$(sed '/^== bugs/q' run.out | grep -c '^BUG')inbugs=$(sed '1,/^== bugs/d' run.out | grep -c '^BUG')echo 2>&1 $inbugs known bugs';' $notinbugs unexpected bugs$diffmsgif [ "$failed" != "0" ]; thenecho FAILEDfiexit $failed
