pass: allow consecutive labels (#123)

Fixes #122
This commit is contained in:
Michael McLoughlin
2020-01-19 22:06:52 -08:00
committed by GitHub
parent cde7e9483b
commit ff7a160610
8 changed files with 123 additions and 19 deletions

View File

@@ -0,0 +1,16 @@
package issue122
import (
"testing"
)
//go:generate go run asm.go -out issue122.s -stubs stub.go
func TestTriangle(t *testing.T) {
expect := func(n uint64) uint64 { return n * (n + 1) / 2 }
for n := uint64(1); n < 42; n++ {
if got := Triangle(n); expect(n) != got {
t.Fatalf("Triangle(%v) = %v; expect %v", n, got, expect(n))
}
}
}