| 1 |
package gp8 |
| 2 |
|
| 3 |
import ( |
| 4 |
"testing" |
| 5 |
) |
| 6 |
|
| 7 |
//go:generate go run asm.go -out gp8.s -stubs stub.go |
| 8 |
|
| 9 |
func TestGP8(t *testing.T) { |
| 10 |
const n = 19 |
| 11 |
expect := uint8(n * (n + 1) / 2) |
| 12 |
if got := GP8(); got != expect { |
| 13 |
t.Fatalf("GP8() = %d; expect %d", got, expect) |
| 14 |
} |
| 15 |
} |