1 env GO111MODULE=off
2 [short] skip # rebuilds std for mips
3
4 # Set up fresh GOCACHE.
5 env GOCACHE=$WORK/gocache
6 mkdir $GOCACHE
7
8 # Building for mipsle without setting GOMIPS will use floating point registers.
9 env GOARCH=mipsle
10 env GOOS=linux
11 go build -gcflags=-S f.go
12 stderr ADDD.F[0-9]+,.F[0-9]+,.F[0-9]+
13
14 # Clean cache
15 go clean -cache
16
17 # Building with GOMIPS=softfloat will not use floating point registers
18 env GOMIPS=softfloat
19 go build -gcflags=-S f.go
20 ! stderr ADDD.F[0-9]+,.F[0-9]+,.F[0-9]+
21
22 # Clean cache
23 go clean -cache
24
25 # Build without setting GOMIPS
26 env GOMIPS=
27 go build -gcflags=-S f.go
28 stderr ADDD.F[0-9]+,.F[0-9]+,.F[0-9]+
29
30 # Building with GOMIPS should still not use floating point registers.
31 env GOMIPS=softfloat
32 go build -gcflags=-S f.go
33 ! stderr ADDD.F[0-9]+,.F[0-9]+,.F[0-9]+
34
35 -- f.go --
36 package f
37
38 func F(x float64) float64 {
39 return x + x
40 }
41
View as plain text