From: erifan01 Date: Wed, 7 Jun 2023 06:49:00 +0000 (+0800) Subject: cmd/asm: initialize assembler before running error tests X-Git-Tag: go1.22rc1~1543 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=b02725a8897ec46e26b99e3be9b9805021c77064;p=gostls13.git cmd/asm: initialize assembler before running error tests 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 Reviewed-by: David Chase TryBot-Result: Gopher Robot Run-TryBot: Eric Fang --- diff --git a/src/cmd/asm/internal/asm/endtoend_test.go b/src/cmd/asm/internal/asm/endtoend_test.go index ef41667c8e..778d17dbd2 100644 --- a/src/cmd/asm/internal/asm/endtoend_test.go +++ b/src/cmd/asm/internal/asm/endtoend_test.go @@ -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)