Files
avo/tests/fixedbugs/issue76/issue76_test.go
Michael McLoughlin 57c23b967e pass: add PruneSelfMoves cleanup pass (#80)
In some cases natural use of abstraction in avo programs can lead to redundant move instructions, specifically self-moves such as MOVQ AX, AX. This does not produce incorrect code but it is incorrect and inelegant.

This diff introduces a PruneSelfMoves pass that removes such unnecessary instructions.

Closes #76
2019-04-14 14:26:28 -07:00

16 lines
286 B
Go

package issue76
import (
"testing"
"testing/quick"
)
//go:generate go run asm.go -out issue76.s -stubs stub.go
func TestIssue76(t *testing.T) {
expect := func(x, y uint64) uint64 { return x + y }
if err := quick.CheckEqual(Issue76, expect, nil); err != nil {
t.Fatal(err)
}
}