Merge from mainline (167278:168000).
[official-gcc/graphite-test-results.git] / gcc / testsuite / go.test / test / env.go
blob7646e07dd687cd02ef37e2d5e8ebfc573a6ac08f
1 // [ $GOOS != nacl ] || exit 0 # NaCl runner does not expose environment
2 // $G $F.go && $L $F.$A && ./$A.out
4 // Copyright 2009 The Go Authors. All rights reserved.
5 // Use of this source code is governed by a BSD-style
6 // license that can be found in the LICENSE file.
8 package main
10 import os "os"
12 func main() {
13 ga, e0 := os.Getenverror("GOARCH")
14 if e0 != nil {
15 print("$GOARCH: ", e0.String(), "\n")
16 os.Exit(1)
18 if ga != "amd64" && ga != "386" && ga != "arm" {
19 print("$GOARCH=", ga, "\n")
20 os.Exit(1)
22 xxx, e1 := os.Getenverror("DOES_NOT_EXIST")
23 if e1 != os.ENOENV {
24 print("$DOES_NOT_EXIST=", xxx, "; err = ", e1.String(), "\n")
25 os.Exit(1)