From 4d35dcfa217ea75ec0d344202d771ca8d9b51a8a Mon Sep 17 00:00:00 2001 From: "Paul E. Murphy" Date: Wed, 16 Oct 2024 10:55:39 -0500 Subject: [PATCH] cmd/asm: add position to PCALIGN directives This allows PCALIGN to be used in the end-to-end assembly tests without causing an error due to missing file position. Change-Id: Iadea2875854ffd544a963acd21293dc9840da2d0 Reviewed-on: https://go-review.googlesource.com/c/go/+/620635 Reviewed-by: Dmitri Shuralyov LUCI-TryBot-Result: Go LUCI Reviewed-by: Cherry Mui --- src/cmd/asm/internal/asm/asm.go | 1 + src/cmd/asm/internal/asm/testdata/ppc64.s | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/cmd/asm/internal/asm/asm.go b/src/cmd/asm/internal/asm/asm.go index b960d8f022..9fc7fa5598 100644 --- a/src/cmd/asm/internal/asm/asm.go +++ b/src/cmd/asm/internal/asm/asm.go @@ -353,6 +353,7 @@ func (p *Parser) asmPCAlign(operands [][]lex.Token) { prog := &obj.Prog{ Ctxt: p.ctxt, As: obj.APCALIGN, + Pos: p.pos(), From: key, } p.append(prog, "", true) diff --git a/src/cmd/asm/internal/asm/testdata/ppc64.s b/src/cmd/asm/internal/asm/testdata/ppc64.s index 918c2e1681..e2c1000e0b 100644 --- a/src/cmd/asm/internal/asm/testdata/ppc64.s +++ b/src/cmd/asm/internal/asm/testdata/ppc64.s @@ -1156,6 +1156,8 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$0 MOVD 4(R1), SPR(3) // ebe100047fe303a6 MOVD 4(R1), XER // ebe100047fe103a6 OR $0, R0, R0 // 60000000 + + PCALIGN $16 PNOP // 0700000000000000 SETB CR1,R3 // 7c640100 -- 2.48.1