]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/dist, misc/cgo: enable tests for aix/ppc64
authorClément Chigot <clement.chigot@atos.net>
Thu, 21 Feb 2019 09:56:35 +0000 (10:56 +0100)
committerIan Lance Taylor <iant@golang.org>
Wed, 20 Mar 2019 14:38:44 +0000 (14:38 +0000)
Some cgo tests aren't yet available on aix/ppc64.
-shared and -static don't work as expected and will be fixed latter.

Updates #30565

Change-Id: Ic59cabe685cb1cbdf89a8d1d1a1d2c4b0e8ef442
Reviewed-on: https://go-review.googlesource.com/c/go/+/164018
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
misc/cgo/test/cthread_unix.c
misc/cgo/test/issue18146.go
misc/cgo/testso/so_test.go
misc/cgo/testsovar/so_test.go
src/cmd/dist/test.go

index 6323e4980e85bcb4f1433c46fcf6ea79fa19382e..247d636d06dc5d45e9c3c0986f499df1ab56b1af 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build darwin dragonfly freebsd linux netbsd openbsd solaris
+// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
 
 #include <pthread.h>
 #include "_cgo_export.h"
index 6483903feddf8dab152a9ac26bca79d18aabc425..0605a24ee9d4de45af9968b61901cda91a7b008b 100644 (file)
@@ -46,6 +46,8 @@ func test18146(t *testing.T) {
        switch runtime.GOOS {
        default:
                setNproc = false
+       case "aix":
+               nproc = 9
        case "linux":
                nproc = 6
        case "darwin", "dragonfly", "freebsd", "netbsd", "openbsd":
index 500b08fae87ddd5f06d28c9179845e3c974c287c..68388caa90375f00cdc30688c4f4c05ab2a89159 100644 (file)
@@ -25,7 +25,12 @@ func requireTestSOSupported(t *testing.T) {
                        t.Skip("No exec facility on iOS.")
                }
        case "ppc64":
-               t.Skip("External linking not implemented on ppc64 (issue #8912).")
+               if runtime.GOOS == "linux" {
+                       t.Skip("External linking not implemented on aix/ppc64 (issue #8912).")
+               }
+               if runtime.GOOS == "aix" {
+                       t.Skip("Using shared object isn't yet available on aix/ppc64 (issue #30565)")
+               }
        case "mips64le", "mips64":
                t.Skip("External linking not implemented on mips64.")
        }
index 500b08fae87ddd5f06d28c9179845e3c974c287c..68388caa90375f00cdc30688c4f4c05ab2a89159 100644 (file)
@@ -25,7 +25,12 @@ func requireTestSOSupported(t *testing.T) {
                        t.Skip("No exec facility on iOS.")
                }
        case "ppc64":
-               t.Skip("External linking not implemented on ppc64 (issue #8912).")
+               if runtime.GOOS == "linux" {
+                       t.Skip("External linking not implemented on aix/ppc64 (issue #8912).")
+               }
+               if runtime.GOOS == "aix" {
+                       t.Skip("Using shared object isn't yet available on aix/ppc64 (issue #30565)")
+               }
        case "mips64le", "mips64":
                t.Skip("External linking not implemented on mips64.")
        }
index 5ecef4494d81200a0997df948b5e8daffbe1610e..eaed9c49464d71c6163ea4b95e2676e760cc5872 100644 (file)
@@ -877,7 +877,8 @@ func (t *tester) out(v string) {
 func (t *tester) extLink() bool {
        pair := gohostos + "-" + goarch
        switch pair {
-       case "android-arm",
+       case "aix-ppc64",
+               "android-arm",
                "darwin-386", "darwin-amd64", "darwin-arm", "darwin-arm64",
                "dragonfly-amd64",
                "freebsd-386", "freebsd-amd64", "freebsd-arm",
@@ -912,6 +913,10 @@ func (t *tester) internalLink() bool {
        if goarch == "arm64" || goarch == "mips64" || goarch == "mips64le" || goarch == "mips" || goarch == "mipsle" {
                return false
        }
+       if goos == "aix" {
+               // linkmode=internal isn't supported.
+               return false
+       }
        return true
 }
 
@@ -1013,7 +1018,8 @@ func (t *tester) cgoTest(dt *distTest) error {
                }
                t.addCmd(dt, "misc/cgo/test", t.goTest(), "-ldflags", "-linkmode=external")
                t.addCmd(dt, "misc/cgo/test", t.goTest(), "-ldflags", "-linkmode=external -s")
-       case "android-arm",
+       case "aix-ppc64",
+               "android-arm",
                "dragonfly-amd64",
                "freebsd-386", "freebsd-amd64", "freebsd-arm",
                "linux-386", "linux-amd64", "linux-arm", "linux-ppc64le", "linux-s390x",
@@ -1027,7 +1033,7 @@ func (t *tester) cgoTest(dt *distTest) error {
                t.addCmd(dt, "misc/cgo/testtls", t.goTest(), "-ldflags", "-linkmode=external")
 
                switch pair {
-               case "netbsd-386", "netbsd-amd64":
+               case "aix-ppc64", "netbsd-386", "netbsd-amd64":
                        // no static linking
                case "freebsd-arm":
                        // -fPIC compiled tls code will use __tls_get_addr instead