tests/alloc/gp8: allocator test using all 8-bit registers (#102)

Updates #43
This commit is contained in:
Michael McLoughlin
2019-12-20 15:31:35 -08:00
committed by GitHub
parent 15d6a9a17e
commit cfc6ecac41
5 changed files with 107 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
package gp8
import (
"testing"
)
//go:generate go run asm.go -out gp8.s -stubs stub.go
func TestGP8(t *testing.T) {
const n = 19
expect := uint8(n * (n + 1) / 2)
if got := GP8(); got != expect {
t.Fatalf("GP8() = %d; expect %d", got, expect)
}
}