From 8fff9166f6bfd7444fe8722f7e79c358f125c4e8 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Mon, 25 Oct 2010 21:25:13 -0700 Subject: [PATCH] arm: enable all tests ARM functionality is now completely working. (Or if it's not, we'll fix it.) R=ken2 CC=golang-dev https://golang.org/cl/2738041 --- src/all-arm.bash | 30 -- src/pkg/runtime/arm/asm.s | 4 +- src/pkg/strconv/atof.go | 4 +- src/pkg/strconv/ftoa.go | 4 - src/pkg/strconv/internal_test.go | 8 - test/arm-pass.txt | 487 ------------------------------- test/fail-arm-native.txt | 11 - test/float_lit.go | 211 ++++++++----- test/golden-arm-native.out | 151 ---------- test/golden-arm.out | 131 --------- test/literal.go | 33 +-- test/recover2.go | 4 +- test/recover3.go | 16 +- test/run | 10 - test/run-arm | 102 ------- 15 files changed, 169 insertions(+), 1037 deletions(-) delete mode 100755 src/all-arm.bash delete mode 100644 test/arm-pass.txt delete mode 100644 test/fail-arm-native.txt delete mode 100644 test/golden-arm-native.out delete mode 100644 test/golden-arm.out delete mode 100755 test/run-arm diff --git a/src/all-arm.bash b/src/all-arm.bash deleted file mode 100755 index 73db3fb85c..0000000000 --- a/src/all-arm.bash +++ /dev/null @@ -1,30 +0,0 @@ -#!/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. - -set -e - -export GOOS=linux -export GOARCH=arm - -bash make.bash - -# TODO(kaib): add in proper tests -#bash run.bash - -set -e - -xcd() { - echo - echo --- cd $1 - builtin cd $1 -} - -# temporarily turn GC off -# TODO(kaib): reenable GC once everything else works -export GOGC=off - -(xcd ../test -./run-arm -) || exit $? diff --git a/src/pkg/runtime/arm/asm.s b/src/pkg/runtime/arm/asm.s index b9e7106d9c..dd317ccdc5 100644 --- a/src/pkg/runtime/arm/asm.s +++ b/src/pkg/runtime/arm/asm.s @@ -64,6 +64,8 @@ TEXT _rt0_arm(SB),7,$-4 TEXT mainstart(SB),7,$4 BL mainĀ·init(SB) BL initdone(SB) + EOR R0, R0 + MOVW R0, 0(R13) BL mainĀ·main(SB) MOVW $0, R0 MOVW R0, 4(SP) @@ -84,7 +86,7 @@ TEXT _dep_dummy(SB),7,$0 BL _sfloat(SB) TEXT breakpoint(SB),7,$0 - BL abort(SB) + // no breakpoint yet; let program exit RET /* diff --git a/src/pkg/strconv/atof.go b/src/pkg/strconv/atof.go index 1e548012b4..262a8b53c7 100644 --- a/src/pkg/strconv/atof.go +++ b/src/pkg/strconv/atof.go @@ -15,11 +15,9 @@ package strconv import ( "math" "os" - "runtime" ) -// TODO(rsc): remove "arm" check -var optimize = runtime.GOARCH != "arm" // can change for testing +var optimize = true // can change for testing // TODO(rsc): Better truncation handling. func stringToDecimal(s string) (neg bool, d *decimal, trunc bool, ok bool) { diff --git a/src/pkg/strconv/ftoa.go b/src/pkg/strconv/ftoa.go index 2e0c0438b8..3659243c79 100644 --- a/src/pkg/strconv/ftoa.go +++ b/src/pkg/strconv/ftoa.go @@ -11,7 +11,6 @@ package strconv import "math" -import "runtime" // TODO: move elsewhere? type floatInfo struct { @@ -24,9 +23,6 @@ var float32info = floatInfo{23, 8, -127} var float64info = floatInfo{52, 11, -1023} func floatsize() int { - if runtime.GOARCH == "arm" { // TODO(rsc): remove - return 32 - } // Figure out whether float is float32 or float64. // 1e-35 is representable in both, but 1e-70 // is too small for a float32. diff --git a/src/pkg/strconv/internal_test.go b/src/pkg/strconv/internal_test.go index 142fbe1a89..9a7f4f0867 100644 --- a/src/pkg/strconv/internal_test.go +++ b/src/pkg/strconv/internal_test.go @@ -6,17 +6,9 @@ package strconv -import "runtime" - func NewDecimal(i uint64) *decimal { return newDecimal(i) } func SetOptimize(b bool) bool { - if runtime.GOARCH == "arm" { - // optimize is always false on arm, - // because the software floating point - // has such terrible multiplication. - return false - } old := optimize optimize = b return old diff --git a/test/arm-pass.txt b/test/arm-pass.txt deleted file mode 100644 index 36852ed4c0..0000000000 --- a/test/arm-pass.txt +++ /dev/null @@ -1,487 +0,0 @@ -./235.go -# ./64bit.go # fail, flaky on android build -./args.go -./assign.go -./assign1.go -./bigalg.go -./bigmap.go -./blank.go -./blank1.go -./chancap.go -./char_lit.go -./char_lit1.go -./closedchan.go -./closure.go -./cmp1.go -./cmp2.go -./cmp3.go -./cmp4.go -./cmp5.go -./cmplx.go -# ./cmplxdivide.go # fail, BUG -./cmplxdivide1.go -./complit.go -./compos.go -./const.go -./const1.go -./const2.go -./const3.go -./convert.go -./convert3.go -./convlit.go -./convlit1.go -./copy.go -./ddd.go -./ddd1.go -./ddd2.go -./ddd3.go -./decl.go -./declbad.go -./defer.go -./deferprint.go -./empty.go -./env.go -./escape.go -./float_lit.go -./floatcmp.go -./for.go -./func.go -./func1.go -./func2.go -./func3.go -./func4.go -./func5.go -./gc.go -./gc1.go -./hashmap.go -./helloworld.go -./if.go -./if1.go -./import.go -./import1.go -./import2.go -./import3.go -./import4.go -./indirect.go -./indirect1.go -./initcomma.go -./initialize.go -./initializerr.go -./initsyscall.go -./int_lit.go -./intcvt.go -./iota.go -./literal.go -./malloc1.go -# ./mallocfin.go # fail -./mallocrand.go -./mallocrep.go -./mallocrep1.go -# ./map.go # fail -./method.go -./method1.go -./method2.go -./method3.go -./named.go -./named1.go -./nil.go -./nul1.go -./parentype.go -./peano.go -./printbig.go -./range.go -./recover.go -./recover1.go -./recover2.go -# ./recover3.go # fail -./rename.go -./rename1.go -./runtime.go -./sieve.go -./sigchld.go -./simassign.go -./sinit.go -./stack.go -./string_lit.go -./stringrange.go -./switch.go -./switch1.go -./test0.go -./turing.go -./typeswitch.go -./typeswitch1.go -./typeswitch2.go -./undef.go -./utf.go -./varerr.go -./varinit.go -./vectors.go -# ./zerodivide.go # regalloc fails -ken/array.go -ken/chan.go -ken/chan1.go -ken/complit.go -# ken/cplx0.go # output fail -# ken/cplx1.go # fail -# ken/cplx2.go # fail -# ken/cplx3.go # output fail -# ken/cplx4.go # fail, BUG -# ken/cplx5.go # output fail -ken/divconst.go -ken/divmod.go -ken/embed.go -ken/for.go -ken/interbasic.go -ken/interfun.go -ken/intervar.go -ken/label.go -ken/litfun.go -ken/mfunc.go -ken/modconst.go -ken/ptrfun.go -ken/ptrvar.go -ken/range.go -ken/rob1.go -ken/rob2.go -ken/robfor.go -ken/robfunc.go -ken/robif.go -ken/shift.go -ken/simparray.go -ken/simpbool.go -ken/simpconv.go -ken/simpfun.go -ken/simpprint.go -ken/simpswitch.go -ken/simpvar.go -ken/slicearray.go -ken/sliceslice.go -ken/string.go -ken/strvar.go -chan/doubleselect.go -chan/fifo.go -chan/goroutines.go -chan/nonblock.go -chan/perm.go -chan/powser1.go -chan/powser2.go -chan/select.go -chan/select2.go -# chan/select3.go # fail -chan/sieve1.go -chan/sieve2.go -interface/bigdata.go -interface/convert.go -interface/convert1.go -interface/convert2.go -interface/embed.go -interface/embed0.go -interface/embed1.go -interface/explicit.go -interface/fail.go -interface/fake.go -interface/pointer.go -interface/receiver.go -interface/receiver1.go -interface/recursive.go -interface/returntype.go -interface/struct.go -nilptr/arrayindex.go -nilptr/arrayindex1.go -nilptr/arraytoslice.go -nilptr/arraytoslice1.go -nilptr/arraytoslice2.go -nilptr/slicearray.go -nilptr/structfield.go -nilptr/structfield1.go -nilptr/structfield2.go -nilptr/structfieldaddr.go -syntax/forvar.go -syntax/import.go -syntax/interface.go -syntax/semi1.go -syntax/semi2.go -syntax/semi3.go -syntax/semi4.go -syntax/semi5.go -syntax/semi6.go -syntax/semi7.go -syntax/topexpr.go -syntax/vareq.go -syntax/vareq1.go -fixedbugs/bug000.go -fixedbugs/bug001.go -fixedbugs/bug002.go -fixedbugs/bug003.go -fixedbugs/bug004.go -fixedbugs/bug005.go -fixedbugs/bug006.go -fixedbugs/bug007.go -fixedbugs/bug008.go -fixedbugs/bug009.go -fixedbugs/bug010.go -fixedbugs/bug011.go -fixedbugs/bug012.go -fixedbugs/bug013.go -fixedbugs/bug014.go -fixedbugs/bug015.go -fixedbugs/bug016.go -fixedbugs/bug017.go -fixedbugs/bug020.go -fixedbugs/bug021.go -fixedbugs/bug022.go -fixedbugs/bug023.go -fixedbugs/bug024.go -fixedbugs/bug026.go -fixedbugs/bug027.go -fixedbugs/bug028.go -fixedbugs/bug030.go -fixedbugs/bug031.go -fixedbugs/bug035.go -fixedbugs/bug036.go -fixedbugs/bug037.go -fixedbugs/bug038.go -fixedbugs/bug039.go -fixedbugs/bug040.go -fixedbugs/bug045.go -fixedbugs/bug046.go -fixedbugs/bug047.go -fixedbugs/bug048.go -fixedbugs/bug049.go -fixedbugs/bug050.go -fixedbugs/bug051.go -fixedbugs/bug052.go -fixedbugs/bug053.go -fixedbugs/bug054.go -fixedbugs/bug055.go -fixedbugs/bug056.go -fixedbugs/bug057.go -fixedbugs/bug058.go -fixedbugs/bug059.go -fixedbugs/bug060.go -fixedbugs/bug061.go -fixedbugs/bug062.go -fixedbugs/bug063.go -fixedbugs/bug064.go -fixedbugs/bug065.go -fixedbugs/bug066.go -fixedbugs/bug067.go -fixedbugs/bug068.go -fixedbugs/bug069.go -fixedbugs/bug070.go -fixedbugs/bug071.go -fixedbugs/bug072.go -fixedbugs/bug073.go -fixedbugs/bug074.go -fixedbugs/bug075.go -fixedbugs/bug076.go -fixedbugs/bug077.go -fixedbugs/bug078.go -fixedbugs/bug080.go -fixedbugs/bug081.go -fixedbugs/bug082.go -fixedbugs/bug083.go -fixedbugs/bug084.go -fixedbugs/bug085.go -fixedbugs/bug086.go -fixedbugs/bug087.go -fixedbugs/bug088.go -fixedbugs/bug089.go -fixedbugs/bug090.go -fixedbugs/bug091.go -fixedbugs/bug092.go -fixedbugs/bug093.go -fixedbugs/bug094.go -fixedbugs/bug096.go -fixedbugs/bug097.go -fixedbugs/bug098.go -fixedbugs/bug099.go -fixedbugs/bug101.go -fixedbugs/bug102.go -fixedbugs/bug103.go -fixedbugs/bug104.go -fixedbugs/bug106.go -fixedbugs/bug107.go -fixedbugs/bug108.go -fixedbugs/bug109.go -fixedbugs/bug110.go -fixedbugs/bug111.go -fixedbugs/bug112.go -fixedbugs/bug113.go -fixedbugs/bug114.go -fixedbugs/bug115.go -fixedbugs/bug116.go -fixedbugs/bug117.go -fixedbugs/bug118.go -fixedbugs/bug119.go -fixedbugs/bug120.go -fixedbugs/bug121.go -fixedbugs/bug122.go -fixedbugs/bug123.go -fixedbugs/bug126.go -fixedbugs/bug127.go -fixedbugs/bug128.go -fixedbugs/bug129.go -fixedbugs/bug130.go -fixedbugs/bug131.go -fixedbugs/bug132.go -fixedbugs/bug133.go -fixedbugs/bug135.go -fixedbugs/bug136.go -fixedbugs/bug137.go -fixedbugs/bug139.go -fixedbugs/bug140.go -fixedbugs/bug141.go -fixedbugs/bug142.go -fixedbugs/bug143.go -fixedbugs/bug144.go -fixedbugs/bug145.go -fixedbugs/bug146.go -fixedbugs/bug147.go -fixedbugs/bug148.go -fixedbugs/bug149.go -fixedbugs/bug150.go -fixedbugs/bug151.go -fixedbugs/bug152.go -fixedbugs/bug154.go -fixedbugs/bug155.go -fixedbugs/bug156.go -fixedbugs/bug157.go -fixedbugs/bug158.go -fixedbugs/bug159.go -fixedbugs/bug160.go -fixedbugs/bug161.go -fixedbugs/bug163.go -fixedbugs/bug164.go -fixedbugs/bug165.go -fixedbugs/bug167.go -fixedbugs/bug168.go -fixedbugs/bug169.go -fixedbugs/bug170.go -fixedbugs/bug171.go -fixedbugs/bug172.go -fixedbugs/bug173.go -fixedbugs/bug174.go -fixedbugs/bug175.go -fixedbugs/bug176.go -fixedbugs/bug177.go -fixedbugs/bug178.go -fixedbugs/bug179.go -fixedbugs/bug180.go -fixedbugs/bug181.go -fixedbugs/bug182.go -fixedbugs/bug183.go -fixedbugs/bug184.go -fixedbugs/bug185.go -fixedbugs/bug186.go -fixedbugs/bug187.go -fixedbugs/bug188.go -fixedbugs/bug189.go -fixedbugs/bug190.go -fixedbugs/bug191.go -fixedbugs/bug192.go -fixedbugs/bug193.go -fixedbugs/bug194.go -fixedbugs/bug195.go -fixedbugs/bug196.go -fixedbugs/bug197.go -fixedbugs/bug198.go -fixedbugs/bug199.go -fixedbugs/bug200.go -fixedbugs/bug201.go -fixedbugs/bug202.go -fixedbugs/bug203.go -fixedbugs/bug204.go -fixedbugs/bug205.go -fixedbugs/bug206.go -fixedbugs/bug207.go -fixedbugs/bug208.go -fixedbugs/bug209.go -fixedbugs/bug211.go -fixedbugs/bug212.go -fixedbugs/bug213.go -fixedbugs/bug214.go -fixedbugs/bug215.go -fixedbugs/bug216.go -fixedbugs/bug217.go -fixedbugs/bug218.go -fixedbugs/bug219.go -fixedbugs/bug220.go -fixedbugs/bug221.go -fixedbugs/bug222.go -fixedbugs/bug223.go -fixedbugs/bug224.go -fixedbugs/bug225.go -fixedbugs/bug226.go -fixedbugs/bug227.go -fixedbugs/bug228.go -fixedbugs/bug229.go -fixedbugs/bug230.go -fixedbugs/bug231.go -fixedbugs/bug232.go -fixedbugs/bug233.go -fixedbugs/bug234.go -fixedbugs/bug235.go -fixedbugs/bug236.go -fixedbugs/bug237.go -fixedbugs/bug238.go -fixedbugs/bug239.go -fixedbugs/bug240.go -fixedbugs/bug241.go -fixedbugs/bug242.go -# fixedbugs/bug243.go # fail, flaky on android build -fixedbugs/bug244.go -fixedbugs/bug245.go -fixedbugs/bug246.go -fixedbugs/bug247.go -fixedbugs/bug248.go -fixedbugs/bug249.go -fixedbugs/bug250.go -fixedbugs/bug251.go -fixedbugs/bug252.go -fixedbugs/bug253.go -fixedbugs/bug254.go -fixedbugs/bug255.go -fixedbugs/bug256.go -fixedbugs/bug257.go -fixedbugs/bug258.go -fixedbugs/bug259.go -fixedbugs/bug261.go -fixedbugs/bug262.go -fixedbugs/bug263.go -fixedbugs/bug264.go -fixedbugs/bug265.go -fixedbugs/bug266.go -fixedbugs/bug267.go -fixedbugs/bug268.go -fixedbugs/bug269.go -fixedbugs/bug270.go -fixedbugs/bug271.go -fixedbugs/bug272.go -fixedbugs/bug273.go -fixedbugs/bug274.go -fixedbugs/bug275.go -fixedbugs/bug276.go -fixedbugs/bug277.go -fixedbugs/bug278.go -fixedbugs/bug279.go -fixedbugs/bug280.go -fixedbugs/bug281.go -fixedbugs/bug282.go -fixedbugs/bug283.go -fixedbugs/bug284.go -fixedbugs/bug285.go -fixedbugs/bug286.go -fixedbugs/bug287.go -fixedbugs/bug288.go -fixedbugs/bug289.go -fixedbugs/bug290.go -fixedbugs/bug291.go -fixedbugs/bug292.go -fixedbugs/bug293.go -fixedbugs/bug294.go -fixedbugs/bug295.go -fixedbugs/bug296.go -fixedbugs/bug297.go -fixedbugs/bug298.go -# bugs/bug260.go # fail, BUG diff --git a/test/fail-arm-native.txt b/test/fail-arm-native.txt deleted file mode 100644 index 6403a54a82..0000000000 --- a/test/fail-arm-native.txt +++ /dev/null @@ -1,11 +0,0 @@ -./cmplxdivide.go -./mallocfin.go -./map.go -./recover3.go -./zerodivide.go -ken/cplx0.go -ken/cplx1.go -ken/cplx2.go -ken/cplx3.go -ken/cplx4.go -ken/cplx5.go diff --git a/test/float_lit.go b/test/float_lit.go index 3ffc5c1e4f..7b91d88e51 100644 --- a/test/float_lit.go +++ b/test/float_lit.go @@ -6,29 +6,19 @@ package main -import "os" - -var deLim float64 var bad bool -func -init() { - if os.Getenv("GOARCH") == "arm" { - deLim = 1.0e-8 - } else { - deLim = 10.e-14 +func pow10(pow int) float64 { + if pow < 0 { + return 1 / pow10(-pow) + } + if pow > 0 { + return pow10(pow-1) * 10 } -} - -func -pow10(pow int) float64 { - if pow < 0 { return 1/pow10(-pow); } - if pow > 0 { return pow10(pow-1)*10; } return 1 } -func -close(da float64, ia, ib int64, pow int) bool { +func close(da float64, ia, ib int64, pow int) bool { db := float64(ia) / float64(ib) db *= pow10(pow) @@ -39,12 +29,12 @@ close(da float64, ia, ib int64, pow int) bool { return false } - de := (da-db) /da + de := (da - db) / da if de < 0 { de = -de } - if de < deLim { + if de < 1e-14 { return true } if !bad { @@ -54,65 +44,154 @@ close(da float64, ia, ib int64, pow int) bool { return false } -func -main() { - if !close(0., 0, 1, 0) { print("0. is ", 0., "\n"); } - if !close(+10., 10, 1, 0) { print("+10. is ", +10., "\n"); } - if !close(-210., -210, 1, 0) { print("-210. is ", -210., "\n"); } +func main() { + if !close(0., 0, 1, 0) { + print("0. is ", 0., "\n") + } + if !close(+10., 10, 1, 0) { + print("+10. is ", +10., "\n") + } + if !close(-210., -210, 1, 0) { + print("-210. is ", -210., "\n") + } - if !close(.0, 0, 1, 0) { print(".0 is ", .0, "\n"); } - if !close(+.01, 1, 100, 0) { print("+.01 is ", +.01, "\n"); } - if !close(-.012, -12, 1000, 0) { print("-.012 is ", -.012, "\n"); } + if !close(.0, 0, 1, 0) { + print(".0 is ", .0, "\n") + } + if !close(+.01, 1, 100, 0) { + print("+.01 is ", +.01, "\n") + } + if !close(-.012, -12, 1000, 0) { + print("-.012 is ", -.012, "\n") + } - if !close(0.0, 0, 1, 0) { print("0.0 is ", 0.0, "\n"); } - if !close(+10.01, 1001, 100, 0) { print("+10.01 is ", +10.01, "\n"); } - if !close(-210.012, -210012, 1000, 0) { print("-210.012 is ", -210.012, "\n"); } + if !close(0.0, 0, 1, 0) { + print("0.0 is ", 0.0, "\n") + } + if !close(+10.01, 1001, 100, 0) { + print("+10.01 is ", +10.01, "\n") + } + if !close(-210.012, -210012, 1000, 0) { + print("-210.012 is ", -210.012, "\n") + } - if !close(0E+1, 0, 1, 0) { print("0E+1 is ", 0E+1, "\n"); } - if !close(+10e2, 10, 1, 2) { print("+10e2 is ", +10e2, "\n"); } - if !close(-210e3, -210, 1, 3) { print("-210e3 is ", -210e3, "\n"); } + if !close(0E+1, 0, 1, 0) { + print("0E+1 is ", 0E+1, "\n") + } + if !close(+10e2, 10, 1, 2) { + print("+10e2 is ", +10e2, "\n") + } + if !close(-210e3, -210, 1, 3) { + print("-210e3 is ", -210e3, "\n") + } - if !close(0E-1, 0, 1, 0) { print("0E-1 is ", 0E-1, "\n"); } - if !close(+0e23, 0, 1, 1) { print("+0e23 is ", +0e23, "\n"); } - if !close(-0e345, 0, 1, 1) { print("-0e345 is ", -0e345, "\n"); } + if !close(0E-1, 0, 1, 0) { + print("0E-1 is ", 0E-1, "\n") + } + if !close(+0e23, 0, 1, 1) { + print("+0e23 is ", +0e23, "\n") + } + if !close(-0e345, 0, 1, 1) { + print("-0e345 is ", -0e345, "\n") + } - if !close(0E1, 0, 1, 1) { print("0E1 is ", 0E1, "\n"); } - if !close(+10e23, 10, 1, 23) { print("+10e23 is ", +10e23, "\n"); } - if !close(-210e34, -210, 1, 34) { print("-210e34 is ", -210e34, "\n"); } + if !close(0E1, 0, 1, 1) { + print("0E1 is ", 0E1, "\n") + } + if !close(+10e23, 10, 1, 23) { + print("+10e23 is ", +10e23, "\n") + } + if !close(-210e34, -210, 1, 34) { + print("-210e34 is ", -210e34, "\n") + } - if !close(0.E1, 0, 1, 1) { print("0.E1 is ", 0.E1, "\n"); } - if !close(+10.e+2, 10, 1, 2) { print("+10.e+2 is ", +10.e+2, "\n"); } - if !close(-210.e-3, -210, 1, -3) { print("-210.e-3 is ", -210.e-3, "\n"); } + if !close(0.E1, 0, 1, 1) { + print("0.E1 is ", 0.E1, "\n") + } + if !close(+10.e+2, 10, 1, 2) { + print("+10.e+2 is ", +10.e+2, "\n") + } + if !close(-210.e-3, -210, 1, -3) { + print("-210.e-3 is ", -210.e-3, "\n") + } - if !close(.0E1, 0, 1, 1) { print(".0E1 is ", .0E1, "\n"); } - if !close(+.01e2, 1, 100, 2) { print("+.01e2 is ", +.01e2, "\n"); } - if !close(-.012e3, -12, 1000, 3) { print("-.012e3 is ", -.012e3, "\n"); } + if !close(.0E1, 0, 1, 1) { + print(".0E1 is ", .0E1, "\n") + } + if !close(+.01e2, 1, 100, 2) { + print("+.01e2 is ", +.01e2, "\n") + } + if !close(-.012e3, -12, 1000, 3) { + print("-.012e3 is ", -.012e3, "\n") + } - if !close(0.0E1, 0, 1, 0) { print("0.0E1 is ", 0.0E1, "\n"); } - if !close(+10.01e2, 1001, 100, 2) { print("+10.01e2 is ", +10.01e2, "\n"); } - if !close(-210.012e3, -210012, 1000, 3) { print("-210.012e3 is ", -210.012e3, "\n"); } + if !close(0.0E1, 0, 1, 0) { + print("0.0E1 is ", 0.0E1, "\n") + } + if !close(+10.01e2, 1001, 100, 2) { + print("+10.01e2 is ", +10.01e2, "\n") + } + if !close(-210.012e3, -210012, 1000, 3) { + print("-210.012e3 is ", -210.012e3, "\n") + } - if !close(0.E+12, 0, 1, 0) { print("0.E+12 is ", 0.E+12, "\n"); } - if !close(+10.e23, 10, 1, 23) { print("+10.e23 is ", +10.e23, "\n"); } - if !close(-210.e33, -210, 1, 33) { print("-210.e33 is ", -210.e33, "\n"); } + if !close(0.E+12, 0, 1, 0) { + print("0.E+12 is ", 0.E+12, "\n") + } + if !close(+10.e23, 10, 1, 23) { + print("+10.e23 is ", +10.e23, "\n") + } + if !close(-210.e33, -210, 1, 33) { + print("-210.e33 is ", -210.e33, "\n") + } - if !close(.0E-12, 0, 1, 0) { print(".0E-12 is ", .0E-12, "\n"); } - if !close(+.01e23, 1, 100, 23) { print("+.01e23 is ", +.01e23, "\n"); } - if !close(-.012e34, -12, 1000, 34) { print("-.012e34 is ", -.012e34, "\n"); } + if !close(.0E-12, 0, 1, 0) { + print(".0E-12 is ", .0E-12, "\n") + } + if !close(+.01e23, 1, 100, 23) { + print("+.01e23 is ", +.01e23, "\n") + } + if !close(-.012e34, -12, 1000, 34) { + print("-.012e34 is ", -.012e34, "\n") + } - if !close(0.0E12, 0, 1, 12) { print("0.0E12 is ", 0.0E12, "\n"); } - if !close(+10.01e23, 1001, 100, 23) { print("+10.01e23 is ", +10.01e23, "\n"); } - if !close(-210.012e33, -210012, 1000, 33) { print("-210.012e33 is ", -210.012e33, "\n"); } + if !close(0.0E12, 0, 1, 12) { + print("0.0E12 is ", 0.0E12, "\n") + } + if !close(+10.01e23, 1001, 100, 23) { + print("+10.01e23 is ", +10.01e23, "\n") + } + if !close(-210.012e33, -210012, 1000, 33) { + print("-210.012e33 is ", -210.012e33, "\n") + } - if !close(0.E123, 0, 1, 123) { print("0.E123 is ", 0.E123, "\n"); } - if !close(+10.e+23, 10, 1, 23) { print("+10.e+234 is ", +10.e+234, "\n"); } - if !close(-210.e-35, -210, 1, -35) { print("-210.e-35 is ", -210.e-35, "\n"); } + if !close(0.E123, 0, 1, 123) { + print("0.E123 is ", 0.E123, "\n") + } + if !close(+10.e+23, 10, 1, 23) { + print("+10.e+234 is ", +10.e+234, "\n") + } + if !close(-210.e-35, -210, 1, -35) { + print("-210.e-35 is ", -210.e-35, "\n") + } - if !close(.0E123, 0, 1, 123) { print(".0E123 is ", .0E123, "\n"); } - if !close(+.01e29, 1, 100, 29) { print("+.01e29 is ", +.01e29, "\n"); } - if !close(-.012e29, -12, 1000, 29) { print("-.012e29 is ", -.012e29, "\n"); } + if !close(.0E123, 0, 1, 123) { + print(".0E123 is ", .0E123, "\n") + } + if !close(+.01e29, 1, 100, 29) { + print("+.01e29 is ", +.01e29, "\n") + } + if !close(-.012e29, -12, 1000, 29) { + print("-.012e29 is ", -.012e29, "\n") + } - if !close(0.0E123, 0, 1, 123) { print("0.0E123 is ", 0.0E123, "\n"); } - if !close(+10.01e31, 1001, 100, 31) { print("+10.01e31 is ", +10.01e31, "\n"); } - if !close(-210.012e19, -210012, 1000, 19) { print("-210.012e19 is ", -210.012e19, "\n"); } + if !close(0.0E123, 0, 1, 123) { + print("0.0E123 is ", 0.0E123, "\n") + } + if !close(+10.01e31, 1001, 100, 31) { + print("+10.01e31 is ", +10.01e31, "\n") + } + if !close(-210.012e19, -210012, 1000, 19) { + print("-210.012e19 is ", -210.012e19, "\n") + } } diff --git a/test/golden-arm-native.out b/test/golden-arm-native.out deleted file mode 100644 index 068985daaa..0000000000 --- a/test/golden-arm-native.out +++ /dev/null @@ -1,151 +0,0 @@ - -== ./ - -=========== ./cmp2.go -panic: runtime error: comparing uncomparable type []int - -panic PC=xxx - -=========== ./cmp3.go -panic: runtime error: comparing uncomparable type []int - -panic PC=xxx - -=========== ./cmp4.go -panic: runtime error: hash of unhashable type []int - -panic PC=xxx - -=========== ./cmp5.go -panic: runtime error: hash of unhashable type []int - -panic PC=xxx - -=========== ./deferprint.go -printing: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 -42 true false true +1.500000e+000 world 0x0 [0/0]0x0 0x0 0x0 255 - -=========== ./helloworld.go -hello, world - -=========== ./peano.go -0! = 1 -1! = 1 -2! = 2 -3! = 6 -4! = 24 -5! = 120 -6! = 720 -7! = 5040 -8! = 40320 -9! = 362880 - -=========== ./printbig.go --9223372036854775808 -9223372036854775807 - -=========== ./sigchld.go -survived SIGCHLD - -=========== ./sinit.go -FAIL - -=========== ./turing.go -Hello World! - -== ken/ - -=========== ken/intervar.go - print 1 bio 2 file 3 -- abc - -=========== ken/label.go -100 - -=========== ken/rob1.go -9876543210 - -=========== ken/rob2.go -(defn foo (add 12 34)) - -=========== ken/simpprint.go -hello world - -=========== ken/simpswitch.go -0out01out12out2aout34out4fiveout56out6aout78out89out9 - -=========== ken/string.go -abcxyz-abcxyz-abcxyz-abcxyz-abcxyz-abcxyz-abcxyz - -== chan/ - -=========== chan/doubleselect.go -PASS - -=========== chan/nonblock.go -PASS - -== interface/ - -=========== interface/fail.go -panic: interface conversion: *main.S is not main.I: missing method Foo - -panic PC=xxx - -=========== interface/returntype.go -panic: interface conversion: *main.S is not main.I2: missing method Name - -panic PC=xxx - -== nilptr/ - -== syntax/ - -== fixedbugs/ - -=========== fixedbugs/bug016.go -fixedbugs/bug016.go:11: constant -3 overflows uint - -=========== fixedbugs/bug027.go -hi -0 44444 -1 3333 -2 222 -3 11 -4 0 -0 44444 -1 3333 -2 222 -3 11 -4 0 - -=========== fixedbugs/bug067.go -ok - -=========== fixedbugs/bug070.go -outer loop top k 0 -inner loop top i 0 -do break -broke - -=========== fixedbugs/bug081.go -fixedbugs/bug081.go:9: typechecking loop - -=========== fixedbugs/bug093.go -M - -=========== fixedbugs/bug113.go -panic: interface conversion: interface is int, not int32 - -panic PC=xxx - -=========== fixedbugs/bug148.go -2 3 -panic: interface conversion: interface is main.T, not main.T - -panic PC=xxx - -== bugs/ - -=========== bugs/bug260.go -FAIL -BUG: bug260 failed diff --git a/test/golden-arm.out b/test/golden-arm.out deleted file mode 100644 index 41829fb036..0000000000 --- a/test/golden-arm.out +++ /dev/null @@ -1,131 +0,0 @@ - -=========== ./cmp2.go -panic: runtime error: comparing uncomparable type []int - -panic PC=xxx - -=========== ./cmp3.go -panic: runtime error: comparing uncomparable type []int - -panic PC=xxx - -=========== ./cmp4.go -panic: runtime error: hash of unhashable type []int - -panic PC=xxx - -=========== ./cmp5.go -panic: runtime error: hash of unhashable type []int - -panic PC=xxx - -=========== ./deferprint.go -printing: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 -42 true false true +1.500000e+000 world 0x0 [0/0]0x0 0x0 0x0 255 - -=========== ./helloworld.go -hello, world - -=========== ./peano.go -0! = 1 -1! = 1 -2! = 2 -3! = 6 -4! = 24 -5! = 120 -6! = 720 -7! = 5040 -8! = 40320 -9! = 362880 - -=========== ./printbig.go --9223372036854775808 -9223372036854775807 - -=========== ./sigchld.go -survived SIGCHLD - -=========== ./sinit.go -FAIL - -=========== ./turing.go -Hello World! - -=========== ken/intervar.go - print 1 bio 2 file 3 -- abc - -=========== ken/label.go -100 - -=========== ken/rob1.go -9876543210 - -=========== ken/rob2.go -(defn foo (add 12 34)) - -=========== ken/simpprint.go -hello world - -=========== ken/simpswitch.go -0out01out12out2aout34out4fiveout56out6aout78out89out9 - -=========== ken/string.go -abcxyz-abcxyz-abcxyz-abcxyz-abcxyz-abcxyz-abcxyz - -=========== chan/doubleselect.go -PASS - -=========== chan/nonblock.go -PASS - -=========== interface/fail.go -panic: interface conversion: *main.S is not main.I: missing method Foo - -panic PC=xxx - -=========== interface/returntype.go -panic: interface conversion: *main.S is not main.I2: missing method Name - -panic PC=xxx - -=========== fixedbugs/bug016.go -fixedbugs/bug016.go:11: constant -3 overflows uint - -=========== fixedbugs/bug027.go -hi -0 44444 -1 3333 -2 222 -3 11 -4 0 -0 44444 -1 3333 -2 222 -3 11 -4 0 - -=========== fixedbugs/bug067.go -ok - -=========== fixedbugs/bug070.go -outer loop top k 0 -inner loop top i 0 -do break -broke - -=========== fixedbugs/bug081.go -fixedbugs/bug081.go:9: typechecking loop - -=========== fixedbugs/bug093.go -M - -=========== fixedbugs/bug113.go -panic: interface conversion: interface is int, not int32 - -panic PC=xxx - -=========== fixedbugs/bug148.go -2 3 -panic: interface conversion: interface is main.T, not main.T - -panic PC=xxx diff --git a/test/literal.go b/test/literal.go index 10176bc387..9bdbabca86 100644 --- a/test/literal.go +++ b/test/literal.go @@ -6,8 +6,6 @@ package main -import "os" - var nbad int func assert(cond bool, msg string) { @@ -21,15 +19,7 @@ func assert(cond bool, msg string) { } func equal(a, b float) bool { - if os.Getenv("GOARCH") != "arm" { - return a == b - } - d := a-b - if a > b { - return d < a * 1.0e-7 - } - d = -d - return d < b * 1.0e-7 + return a == b } @@ -47,7 +37,7 @@ func main() { var i04 int8 = -127 var i05 int8 = -128 var i06 int8 = +127 - assert(i01 == i00 + 1, "i01") + assert(i01 == i00+1, "i01") assert(i02 == -i01, "i02") assert(i03 == -i04, "i03") assert(-(i05+1) == i06, "i05") @@ -60,7 +50,7 @@ func main() { var i14 int16 = -32767 var i15 int16 = -32768 var i16 int16 = +32767 - assert(i11 == i10 + 1, "i11") + assert(i11 == i10+1, "i11") assert(i12 == -i11, "i12") assert(i13 == -i14, "i13") assert(-(i15+1) == i16, "i15") @@ -73,11 +63,11 @@ func main() { var i24 int32 = -2147483647 var i25 int32 = -2147483648 var i26 int32 = +2147483647 - assert(i21 == i20 + 1, "i21") + assert(i21 == i20+1, "i21") assert(i22 == -i21, "i22") assert(i23 == -i24, "i23") assert(-(i25+1) == i26, "i25") - assert(i23 == (1 << 31) - 1, "i23 size") + assert(i23 == (1<<31)-1, "i23 size") // int64 var i30 int64 = 0 @@ -87,27 +77,27 @@ func main() { var i34 int64 = -9223372036854775807 var i35 int64 = -9223372036854775808 var i36 int64 = +9223372036854775807 - assert(i31 == i30 + 1, "i31") + assert(i31 == i30+1, "i31") assert(i32 == -i31, "i32") assert(i33 == -i34, "i33") assert(-(i35+1) == i36, "i35") - assert(i33 == (1<<63) - 1, "i33 size") + assert(i33 == (1<<63)-1, "i33 size") // uint8 var u00 uint8 = 0 var u01 uint8 = 1 var u02 uint8 = 255 var u03 uint8 = +255 - assert(u01 == u00 + 1, "u01") + assert(u01 == u00+1, "u01") assert(u02 == u03, "u02") - assert(u03 == (1<<8) - 1, "u03 size") + assert(u03 == (1<<8)-1, "u03 size") // uint16 var u10 uint16 = 0 var u11 uint16 = 1 var u12 uint16 = 65535 var u13 uint16 = +65535 - assert(u11 == u10 + 1, "u11") + assert(u11 == u10+1, "u11") assert(u12 == u13, "u12") // uint32 @@ -115,7 +105,7 @@ func main() { var u21 uint32 = 1 var u22 uint32 = 4294967295 var u23 uint32 = +4294967295 - assert(u21 == u20 + 1, "u21") + assert(u21 == u20+1, "u21") assert(u22 == u23, "u22") // uint64 @@ -179,7 +169,6 @@ func main() { assert(c8 == 0x0b, "c8") assert(c9 == 0x672c, "c9") - var c00 uint8 = '\000' var c01 uint8 = '\007' var c02 uint8 = '\177' diff --git a/test/recover2.go b/test/recover2.go index c95af8f62f..48b0503309 100644 --- a/test/recover2.go +++ b/test/recover2.go @@ -83,8 +83,8 @@ func test6() { } func test7() { - if syscall.ARCH == "arm" || syscall.OS == "nacl" { - // ARM doesn't have integer divide trap yet + if syscall.OS == "nacl" { + // NaCl cannot handle traps return } defer mustRecover("divide by zero") diff --git a/test/recover3.go b/test/recover3.go index b982ec8fa5..1cb64f2633 100644 --- a/test/recover3.go +++ b/test/recover3.go @@ -10,7 +10,6 @@ package main import ( "runtime" "strings" - "syscall" ) var didbug bool @@ -44,7 +43,7 @@ func check(name string, f func(), err string) { return } }() - + f() } @@ -55,11 +54,8 @@ func main() { var q *[10000]int var i int - // not catching divide by zero on the arm. is that even possible? - if syscall.ARCH != "arm" { - check("int-div-zero", func() { println(1/x) }, "integer divide by zero") - check("int64-div-zero", func() { println(1/x64) }, "integer divide by zero") - } + check("int-div-zero", func() { println(1 / x) }, "integer divide by zero") + check("int64-div-zero", func() { println(1 / x64) }, "integer divide by zero") check("nil-deref", func() { println(p[0]) }, "nil pointer dereference") check("nil-deref-1", func() { println(p[1]) }, "nil pointer dereference") @@ -69,11 +65,13 @@ func main() { var sl []int check("array-bounds", func() { println(p[i]) }, "index out of range") check("slice-bounds", func() { println(sl[i]) }, "index out of range") - + var inter interface{} inter = 1 check("type-concrete", func() { println(inter.(string)) }, "int, not string") check("type-interface", func() { println(inter.(m)) }, "missing method m") } -type m interface{ m() } +type m interface { + m() +} diff --git a/test/run b/test/run index bb709cc9f9..28d0caa0f6 100755 --- a/test/run +++ b/test/run @@ -56,16 +56,6 @@ filterout() { grep '^'"$2"'$' $1 >/dev/null } -if [ "$GOARCH" = "arm" ]; then - if [ "$GORUN" = "" ]; then - exclude="filterout fail-arm-native.txt" - golden=golden-arm-native.out - else - exclude="filterout fail-arm.txt" - golden=golden-arm.out - fi -fi - for dir in . ken chan interface nilptr syntax fixedbugs bugs do echo diff --git a/test/run-arm b/test/run-arm deleted file mode 100755 index b3e3307ed9..0000000000 --- a/test/run-arm +++ /dev/null @@ -1,102 +0,0 @@ -#!/bin/sh -# 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. - -export E="" -case X"$GOARCH" in -Xamd64) - export A=6 - ;; -X386) - export A=8 - ;; -Xarm) - export A=5 - export E="$GORUN" - ;; -*) - echo 1>&2 run: unsupported '$GOARCH' - exit 1 -esac - -export G=${A}g -export L=${A}l -export GOTRACEBACK=0 - -PATH=/bin:/usr/bin:/usr/local/bin:${GOBIN:-$GOROOT/bin}:`pwd` - -RUNFILE=/tmp/gorun-$$-$USER -TMP1FILE=/tmp/gotest1-$$-$USER -TMP2FILE=/tmp/gotest2-$$-$USER -FAILEDFILE=/tmp/gotest3-$$-$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 please -ulimit -c 0 - -true >times.out - -# TODO(kaib): figure out why the GC makes things so utterly slow. -export GOGC=off -export GOTRACEBACK=0 - -for i in $(cat arm-pass.txt | sed 's/#.*//') -do - export F=$(basename $i .go) - dir=$(dirname $i) - export D=$dir - sed '/^\/\//!q' $i | sed 's@//@@; $d' |sed 's|./\$A.out|$E &|' >$RUNFILE - if ! { time -p bash -c "bash $RUNFILE >$TMP1FILE 2>&1" ; } 2>$TMP2FILE - then - echo - echo "===========" $i - cat $TMP1FILE - echo >&2 fail: $i - touch $FAILEDFILE - elif test -s $TMP1FILE - then - echo - echo "===========" $i - cat $TMP1FILE - elif [ $dir = "bugs" ] - then - echo $i succeeded with no output. - fi - echo $(awk 'NR==1{print $2}' $TMP2FILE) $D/$F >>times.out -done | # clean up some stack noise - egrep -v '^(r[0-9a-z]+|[cfg]s) +0x' | - sed '/tmp.*Bus error/s/.*Bus/Bus/; /tmp.*Trace.BPT/s/.*Trace/Trace/ - s!'$RUNFILE'!$RUNFILE!g - s/ PC=0x[0-9a-f]*/ PC=xxx/ - s/^pc: 0x[0-9a-f]*/pc: xxx/ - /^Trace\/breakpoint trap/d - /^Trace\/BPT trap/d - s!'$GOROOT'!$GOROOT!g - /Segmentation fault/d - /RUNFILE/ s/line 1: *[0-9]*/line 1: PID/ - /^\$RUNFILE: line 1: PID Trace\/breakpoint trap/d - /^qemu: uncaught target signal 11 (Segmentation fault) - exiting/d' > run.out - -failed=0 -rm -f $RUNFILE $TMP1FILE $TMP2FILE *.$A $A.out -diffmsg="" -if ! diff -b golden-arm.out run.out -then - diffmsg="; test output differs" - failed=1 -fi - -notinbugs=$(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$diffmsg - -if [ "$failed" != "0" ]; then - echo FAILED -fi - -exit $failed