]> Cypherpunks repositories - gostls13.git/commit
test: add support for code generation tests (asmcheck)
authorGiovanni Bajo <rasky@develer.com>
Tue, 27 Feb 2018 00:59:58 +0000 (01:59 +0100)
committerGiovanni Bajo <rasky@develer.com>
Thu, 1 Mar 2018 07:59:54 +0000 (07:59 +0000)
commitc9438cb198c420648743108b6495aa4c7775f453
tree3b087af56bcc068e03835ced32c994a688a4bd7b
parentc7c01efd96cd8f903b304c1504e9aab1c4e6ba2f
test: add support for code generation tests (asmcheck)

The top-level test harness is modified to support a new kind
of test: "asmcheck". This is meant to replace asm_test.go
as an easier and more readable way to test code generation.

I've added a couple of codegen tests to get initial feedback
on the syntax. I've created them under a common "codegen"
subdirectory, so that it's easier to run them all with
"go run run.go -v codegen".

The asmcheck syntax allows to insert line comments that
can specify a regular expression to match in the assembly code,
for multiple architectures (the testsuite will automatically
build each testfile multiple times, one per mentioned architecture).

Negative matches are unsupported for now, so this cannot fully
replace asm_test yet.

Change-Id: Ifdbba389f01d55e63e73c99e5f5449e642101d55
Reviewed-on: https://go-review.googlesource.com/97355
Run-TryBot: Giovanni Bajo <rasky@develer.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Alberto Donizetti <alb.donizetti@gmail.com>
test/codegen/bits.go [new file with mode: 0644]
test/codegen/rotate.go [new file with mode: 0644]
test/run.go