aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/asm
diff options
context:
space:
mode:
authorPaul E. Murphy <murp@ibm.com>2024-10-16 10:55:39 -0500
committerPaul Murphy <murp@ibm.com>2024-10-21 14:11:44 +0000
commit4d35dcfa217ea75ec0d344202d771ca8d9b51a8a (patch)
tree042dfc43488ac7ec84904158914e4eee5740b1a7 /src/cmd/asm
parentc0a126b8dce5c7ed8f16d8687331159763d1b19d (diff)
downloadgo-4d35dcfa217ea75ec0d344202d771ca8d9b51a8a.tar.xz
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 <dmitshur@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
Diffstat (limited to 'src/cmd/asm')
-rw-r--r--src/cmd/asm/internal/asm/asm.go1
-rw-r--r--src/cmd/asm/internal/asm/testdata/ppc64.s2
2 files changed, 3 insertions, 0 deletions
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