]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/asm: initialize assembler before running error tests
authorerifan01 <eric.fang@arm.com>
Wed, 7 Jun 2023 06:49:00 +0000 (14:49 +0800)
committerEric Fang <eric.fang@arm.com>
Mon, 24 Jul 2023 01:13:17 +0000 (01:13 +0000)
The Test{ARCH}Errors tests will call ctxt.Arch.Assemble, but this
function requires the assembler has been initialized. So this CL adds
a call to architecture.Init(ctxt) in testErrors, otherwise running
Test{ARCH}Errors alone would fail.

Change-Id: I4f3ba5a5fc1375d28779701989cf700cb4d1b635
Reviewed-on: https://go-review.googlesource.com/c/go/+/505976
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Eric Fang <eric.fang@arm.com>

src/cmd/asm/internal/asm/endtoend_test.go

index ef41667c8e871cba9604d2de353eff7c26073fae..778d17dbd2d1a9360cf9629a60005dd31221b9c1 100644 (file)
@@ -272,6 +272,7 @@ var (
 func testErrors(t *testing.T, goarch, file string, flags ...string) {
        input := filepath.Join("testdata", file+".s")
        architecture, ctxt := setArch(goarch)
+       architecture.Init(ctxt)
        lexer := lex.NewLexer(input)
        parser := NewParser(ctxt, architecture, lexer, false)
        pList := new(obj.Plist)