1
0
mirror of https://github.com/golang/go synced 2024-11-19 16:54:44 -07:00

cmd/vendor/golang.org/x/arch: import latest (Aug 18 2017 ffd22fb365cd)

Fixes #21486.

Change-Id: I01794f008404f0e2d8a1408309ae6055513c5b49
Reviewed-on: https://go-review.googlesource.com/57030
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
This commit is contained in:
Russ Cox 2017-08-18 12:11:11 -04:00
parent 9f5f51af7c
commit e9983165dd
2 changed files with 7 additions and 15 deletions

View File

@ -503,7 +503,7 @@ func JSONCases(t *testing.T) func(func([]byte)) {
return func(try func([]byte)) {
data, err := ioutil.ReadFile("inst.json")
if err != nil {
log.Fatal(err)
t.Fatal(err)
}
var insts []InstJson
var instsN []InstJson
@ -513,7 +513,7 @@ func JSONCases(t *testing.T) func(func([]byte)) {
N = 16
}
if err := json.Unmarshal(data, &insts); err != nil {
log.Fatal(err)
t.Fatal(err)
}
// Append instructions to get more test cases.
for i := 0; i < N; {

View File

@ -27,27 +27,19 @@ func testObjdumpARM64(t *testing.T, generate func(func([]byte))) {
}
func testObjdumpArch(t *testing.T, generate func(func([]byte)), arch Mode) {
if _, err := os.Stat(objdumpPath); err != nil {
t.Skip(err)
}
// Check objdump can disassemble elf64-aarch64.
if test := objdumpinfo(); test == false {
t.Skip("Skip the test if installed objdump doesn't support aarch64 elf format")
}
checkObjdumpAarch64(t)
testExtDis(t, "gnu", arch, objdump, generate, allowedMismatchObjdump)
testExtDis(t, "plan9", arch, objdump, generate, allowedMismatchObjdump)
}
func objdumpinfo() bool {
var i = []byte("aarch64")
func checkObjdumpAarch64(t *testing.T) {
out, err := exec.Command(objdumpPath, "-i").Output()
if err != nil {
log.Fatal(err)
t.Skip("cannot run objdump: %v\n%s", err, out)
}
if bytes.Contains(out, i) {
return true
if !strings.Contains(string(out), "aarch64") {
t.Skip("objdump does not have aarch64 support")
}
return false
}
func objdump(ext *ExtDis) error {