OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [go.test/] [test/] [run] - Blame information for rev 700

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 700 jeremybenn
#!/usr/bin/env bash
2
# Copyright 2009 The Go Authors. All rights reserved.
3
# Use of this source code is governed by a BSD-style
4
# license that can be found in the LICENSE file.
5
 
6
eval $(gomake --no-print-directory -f ../src/Make.inc go-env)
7
 
8
export E=
9
 
10
case X"$GOARCH" in
11
Xamd64)
12
        export A=6
13
        ;;
14
X386)
15
        export A=8
16
        ;;
17
Xarm)
18
        export A=5
19
        export E="$GORUN"
20
        ;;
21
*)
22
        echo 1>&2 run: unsupported '$GOARCH'
23
        exit 1
24
esac
25
 
26
export G="${A}g ${GCFLAGS}"
27
export L=${A}l
28
export GOTRACEBACK=0
29
export LANG=C
30
unset GREP_OPTIONS      # in case user has a non-standard set
31
 
32
failed=0
33
 
34
PATH=${GOBIN:-$GOROOT/bin}:`pwd`:/bin:/usr/bin:/usr/local/bin
35
 
36
RUNFILE="/tmp/gorun-$$-$USER"
37
TMP1FILE="/tmp/gotest1-$$-$USER"
38
TMP2FILE="/tmp/gotest2-$$-$USER"
39
 
40
# don't run the machine out of memory: limit individual processes to 4GB.
41
# on thresher, 3GB suffices to run the tests; with 2GB, peano fails.
42
ulimit -v 4000000
43
 
44
# no core files please
45
ulimit -c 0
46
 
47
true >pass.out >times.out
48
 
49
exclude=false   # exclude nothing
50
golden=golden.out
51
 
52
filterout() {
53
        grep '^'"$2"'$' $1 >/dev/null
54
}
55
 
56
for dir in . ken chan interface syntax dwarf fixedbugs bugs
57
do
58
        echo
59
        echo '==' $dir'/'
60
        for i in $(ls $dir/*.go 2>/dev/null)
61
        do (
62
                if $exclude $i; then
63
                        exit 0  # continues for loop
64
                fi
65
                export F=$(basename $i .go)
66
                export D=$dir
67
                sed '/^\/\//!q' $i | sed 's@//@@; $d' |sed 's|./\$A.out|$E &|g' >"$RUNFILE"
68
                if ! { time -p bash -c "bash '$RUNFILE' >'$TMP1FILE' 2>&1" ; } 2>"$TMP2FILE"
69
                then
70
                        echo
71
                        echo "===========" $i
72
                        cat "$TMP1FILE"
73
                        echo >&2 fail: $i
74
                        echo "# $i      # fail" >>pass.out
75
                elif test -s "$TMP1FILE"
76
                then
77
                        echo
78
                        echo "===========" $i
79
                        cat "$TMP1FILE"
80
                        if grep -q '^BUG' "$TMP1FILE"
81
                        then
82
                                if [ $dir != bugs ]
83
                                then
84
                                        echo >&2 bug: $i
85
                                fi
86
                                echo "# $i      # fail, BUG" >>pass.out
87
                        else
88
                                echo $i >>pass.out
89
                        fi
90
                elif [ $dir = "bugs" ]
91
                then
92
                        echo $i succeeded with no output.
93
                else
94
                        echo $i >>pass.out
95
                fi
96
                echo $(awk 'NR==1{print $2}' "$TMP2FILE") $D/$F >>times.out
97
                rm -f $F.$A $A.out
98
        ) done
99
done | # clean up some stack noise
100
        egrep -v '^(r[0-9a-z]+|[cfg]s)  +0x'  |
101
        sed '/tmp.*Bus error/s/.*Bus/Bus/; /tmp.*Trace.BPT/s/.*Trace/Trace/
102
                s!'"$RUNFILE"'!$RUNFILE!g
103
                s/^PC=0x[0-9a-f]*/pc: xxx/
104
                s/^pc: 0x[0-9a-f]*/pc: xxx/
105
                s/PC=0x[0-9a-f]*/PC=xxx/
106
                /^Trace\/breakpoint trap/d
107
                /^Trace\/BPT trap/d
108
                /RUNFILE/ s/line 1: *[0-9]*/line 1: PID/
109
                /^\$RUNFILE: line 1: PID Trace\/breakpoint trap/d
110
                /Segmentation fault/d
111
                /^qemu: uncaught target signal 11 (Segmentation fault) - exiting/d' > run.out
112
 
113
rm -f "$RUNFILE" "$TMP1FILE" "$TMP2FILE" *.$A *.a $A.out
114
diffmsg=""
115
if ! diff $golden run.out
116
then
117
        diffmsg="; test output differs"
118
        failed=1
119
fi
120
 
121
notinbugs=$(sed '/^== bugs/q' run.out | grep -c '^BUG')
122
inbugs=$(sed '1,/^== bugs/d' run.out | grep -c '^BUG')
123
 
124
echo 2>&1 $inbugs known bugs';' $notinbugs unexpected bugs$diffmsg
125
 
126
if [ "$failed" != "0" ]; then
127
        echo FAILED
128
fi
129
 
130
exit $failed

powered by: WebSVN 2.1.0

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