x86: rel types and generated tests

This commit is contained in:
Michael McLoughlin
2018-11-27 22:08:11 -08:00
parent 3881907ec8
commit 4395adacc8
13 changed files with 18188 additions and 19 deletions

View File

@@ -0,0 +1,28 @@
package gen
import (
"testing"
"github.com/mmcloughlin/avo/internal/inst"
)
func TestParamsUniqueArgNames(t *testing.T) {
for _, i := range inst.Instructions {
s := params(i)
for _, n := range i.Arities() {
if n == 0 {
continue
}
names := map[string]bool{}
for j := 0; j < n; j++ {
names[s.ParameterName(j)] = true
}
if len(names) != n {
t.Errorf("repeated argument for instruction %s", i.Opcode)
}
if _, found := names[""]; found {
t.Errorf("empty argument name for instruction %s", i.Opcode)
}
}
}
}