...

Source file src/golang.org/x/arch/x86/x86asm/plan9x_test.go

Documentation: golang.org/x/arch/x86/x86asm

     1  // Copyright 2014 The Go Authors.  All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package x86asm
     6  
     7  import (
     8  	"strings"
     9  	"testing"
    10  )
    11  
    12  func TestPlan932Manual(t *testing.T)   { testPlan932(t, hexCases(t, plan9ManualTests)) }
    13  func TestPlan932Testdata(t *testing.T) { testPlan932(t, concat(basicPrefixes, testdataCases(t))) }
    14  func TestPlan932ModRM(t *testing.T)    { testPlan932(t, concat(basicPrefixes, enumModRM)) }
    15  func TestPlan932OneByte(t *testing.T)  { testBasic(t, testPlan932) }
    16  func TestPlan9320F(t *testing.T)       { testBasic(t, testPlan932, 0x0F) }
    17  func TestPlan9320F38(t *testing.T)     { testBasic(t, testPlan932, 0x0F, 0x38) }
    18  func TestPlan9320F3A(t *testing.T)     { testBasic(t, testPlan932, 0x0F, 0x3A) }
    19  func TestPlan932Prefix(t *testing.T)   { testPrefix(t, testPlan932) }
    20  
    21  func TestPlan964Manual(t *testing.T)   { testPlan964(t, hexCases(t, plan9ManualTests)) }
    22  func TestPlan964Testdata(t *testing.T) { testPlan964(t, concat(basicPrefixes, testdataCases(t))) }
    23  func TestPlan964ModRM(t *testing.T)    { testPlan964(t, concat(basicPrefixes, enumModRM)) }
    24  func TestPlan964OneByte(t *testing.T)  { testBasic(t, testPlan964) }
    25  func TestPlan9640F(t *testing.T)       { testBasic(t, testPlan964, 0x0F) }
    26  func TestPlan9640F38(t *testing.T)     { testBasic(t, testPlan964, 0x0F, 0x38) }
    27  func TestPlan9640F3A(t *testing.T)     { testBasic(t, testPlan964, 0x0F, 0x3A) }
    28  func TestPlan964Prefix(t *testing.T)   { testPrefix(t, testPlan964) }
    29  
    30  func TestPlan964REXTestdata(t *testing.T) {
    31  	testPlan964(t, filter(concat3(basicPrefixes, rexPrefixes, testdataCases(t)), isValidREX))
    32  }
    33  func TestPlan964REXModRM(t *testing.T) {
    34  	testPlan964(t, concat3(basicPrefixes, rexPrefixes, enumModRM))
    35  }
    36  func TestPlan964REXOneByte(t *testing.T) { testBasicREX(t, testPlan964) }
    37  func TestPlan964REX0F(t *testing.T)      { testBasicREX(t, testPlan964, 0x0F) }
    38  func TestPlan964REX0F38(t *testing.T)    { testBasicREX(t, testPlan964, 0x0F, 0x38) }
    39  func TestPlan964REX0F3A(t *testing.T)    { testBasicREX(t, testPlan964, 0x0F, 0x3A) }
    40  func TestPlan964REXPrefix(t *testing.T)  { testPrefixREX(t, testPlan964) }
    41  
    42  // plan9ManualTests holds test cases that will be run by TestPlan9Manual32 and TestPlan9Manual64.
    43  // If you are debugging a few cases that turned up in a longer run, it can be useful
    44  // to list them here and then use -run=Plan9Manual, particularly with tracing enabled.
    45  var plan9ManualTests = `
    46  `
    47  
    48  // allowedMismatchPlan9 reports whether the mismatch between text and dec
    49  // should be allowed by the test.
    50  func allowedMismatchPlan9(text string, size int, inst *Inst, dec ExtInst) bool {
    51  	return false
    52  }
    53  
    54  // Instructions known to us but not to plan9.
    55  var plan9Unsupported = strings.Fields(`
    56  `)
    57  

View as plain text