]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/internal/obj/x86: fix oclass tests for Hsolaris
authorIskander Sharipov <quasilyte@gmail.com>
Tue, 14 May 2019 14:46:55 +0000 (17:46 +0300)
committerBrad Fitzpatrick <bradfitz@golang.org>
Tue, 14 May 2019 19:36:50 +0000 (19:36 +0000)
Use objabi.Hlinux for now.

Fixes #32028

Change-Id: If9745f72c0ee4444ea2a2faa50813d2e1ac2bf97
Reviewed-on: https://go-review.googlesource.com/c/go/+/177077
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/cmd/internal/obj/x86/asm_test.go

index d1499dea7e3c9323648e0706db5a03ef4a53acf8..36c8fce675b7dabe23c9e471d9b6760be6e2f67d 100644 (file)
@@ -6,6 +6,7 @@ package x86
 
 import (
        "cmd/internal/obj"
+       "cmd/internal/objabi"
        "testing"
 )
 
@@ -208,13 +209,17 @@ func TestOclass(t *testing.T) {
                }
        }
 
-       t.Run("AMD64", func(t *testing.T) {
+       // TODO(quasilyte): test edge cases for Hsolaris, etc?
+
+       t.Run("linux/AMD64", func(t *testing.T) {
                ctxtAMD64 := obj.Linknew(&Linkamd64)
+               ctxtAMD64.Headtype = objabi.Hlinux // See #32028
                runTest(t, ctxtAMD64, oclassTestsAMD64)
        })
 
-       t.Run("386", func(t *testing.T) {
+       t.Run("linux/386", func(t *testing.T) {
                ctxt386 := obj.Linknew(&Link386)
+               ctxt386.Headtype = objabi.Hlinux // See #32028
                runTest(t, ctxt386, oclassTests386)
        })
 }