]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/dist: test PIE internal linking on linux/amd64
authorDavid Crawshaw <crawshaw@golang.org>
Tue, 6 Sep 2016 13:16:48 +0000 (09:16 -0400)
committerDavid Crawshaw <crawshaw@golang.org>
Sun, 11 Sep 2016 22:18:22 +0000 (22:18 +0000)
Change-Id: I88dd0811db3a9864106def47b89848f5c8de94d4
Reviewed-on: https://go-review.googlesource.com/28545
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/cmd/dist/test.go

index 7073992e6ed9064c83c3a08105473801b74ed63a..a3c565967fced3f5a4a46894a115ac698b2014ef 100644 (file)
@@ -422,6 +422,18 @@ func (t *tester) registerTests() {
                })
        }
 
+       // Test internal linking of PIE binaries where it is supported.
+       if t.goos == "linux" && t.goarch == "amd64" {
+               t.tests = append(t.tests, distTest{
+                       name:    "pie_internal",
+                       heading: "internal linking of -buildmode=pie",
+                       fn: func(dt *distTest) error {
+                               t.addCmd(dt, "src", "go", "test", "reflect", "-short", "-buildmode=pie", "-ldflags=-linkmode=internal", t.timeout(60), t.tags(), t.runFlag(""))
+                               return nil
+                       },
+               })
+       }
+
        // sync tests
        t.tests = append(t.tests, distTest{
                name:    "sync_cpu",