Commit 1c71ab18 authored by Kai Backman's avatar Kai Backman

added emulator support for arm.

R=rsc
APPROVED=rsc
DELTA=7  (3 added, 0 deleted, 4 changed)
OCL=34661
CL=34820
parent 4a4ec238
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
# Use of this source code is governed by a BSD-style # Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file. # license that can be found in the LICENSE file.
export E=""
case X"$GOARCH" in case X"$GOARCH" in
Xamd64) Xamd64)
export A=6 export A=6
...@@ -12,6 +13,7 @@ X386) ...@@ -12,6 +13,7 @@ X386)
;; ;;
Xarm) Xarm)
export A=5 export A=5
export E="qemu-arm -cpu cortex-a8 "
;; ;;
*) *)
echo 1>&2 run: unsupported '$GOARCH' echo 1>&2 run: unsupported '$GOARCH'
...@@ -24,7 +26,7 @@ export GOTRACEBACK=0 ...@@ -24,7 +26,7 @@ export GOTRACEBACK=0
failed=0 failed=0
PATH=/bin:/usr/bin:${GOBIN:-$HOME/bin}:`pwd` PATH=/bin:/usr/bin:/usr/local/bin:${GOBIN:-$HOME/bin}:`pwd`
RUNFILE=/tmp/gorun-$$-$USER RUNFILE=/tmp/gorun-$$-$USER
TMP1FILE=/tmp/gotest1-$$-$USER TMP1FILE=/tmp/gotest1-$$-$USER
...@@ -42,7 +44,7 @@ do ...@@ -42,7 +44,7 @@ do
do do
export F=$(basename $i .go) export F=$(basename $i .go)
export D=$dir export D=$dir
sed '/^\/\//!q' $i | sed 's@//@@; $d' > $RUNFILE sed '/^\/\//!q; s|//||g; s|./\$A.out|$E &|' $i >$RUNFILE
if ! sh $RUNFILE >$TMP1FILE 2>$TMP2FILE if ! sh $RUNFILE >$TMP1FILE 2>$TMP2FILE
then then
echo echo
...@@ -70,13 +72,14 @@ done | # clean up some stack noise ...@@ -70,13 +72,14 @@ done | # clean up some stack noise
/^Trace\/breakpoint trap/d /^Trace\/breakpoint trap/d
/^Trace\/BPT trap/d /^Trace\/BPT trap/d
/RUNFILE/ s/line 1: *[0-9]*/line 1: PID/ /RUNFILE/ s/line 1: *[0-9]*/line 1: PID/
/^\$RUNFILE: line 1: PID Trace\/breakpoint trap/d' > run.out /^\$RUNFILE: line 1: PID Trace\/breakpoint trap/d
/^qemu: uncaught target signal 11 (Segmentation fault) - exiting/d' > run.out
case $failed in case $failed in
1) 1)
echo FAIL echo FAIL
esac esac
rm -f $RUNFILE $TMP1FILE $TMP2FILE *.6 6.out rm -f $RUNFILE $TMP1FILE $TMP2FILE *.$A $A.out
diffmsg="" diffmsg=""
if ! diff run.out golden.out if ! diff run.out golden.out
then then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment