style: purge em dashes from the produced text
Assisted-by: GLM 5.3 Flash
This commit is contained in:
+1
-1
@@ -20,7 +20,7 @@ import (
|
||||
// architecture's syntax (macros, addressing modes, branch aliases) against
|
||||
// production assembly. It is skipped when the toolchain source is absent.
|
||||
//
|
||||
// The bar is zero parse errors and zero error-severity diagnostics — i.e. no
|
||||
// The bar is zero parse errors and zero error-severity diagnostics; i.e. no
|
||||
// false "unknown instruction" / "undefined label" findings on code the real
|
||||
// assembler accepts. Advisory warnings are reported but not fatal, since they
|
||||
// are heuristics that may legitimately differ across Go versions.
|
||||
|
||||
+7
-7
@@ -48,7 +48,7 @@ func TestFixtureIsClean(t *testing.T) {
|
||||
t.Fatalf("parse: %v", errs)
|
||||
}
|
||||
// The fixture mirrors the go-flac kernels, which write the Go ABI0
|
||||
// scratch registers (BX, R13) without saving them — legal under Go's
|
||||
// scratch registers (BX, R13) without saving them; legal under Go's
|
||||
// stack-based ABI, so the register-clobber audit stays silent and the
|
||||
// fixture must lint entirely clean.
|
||||
diags := File(f, Config{Arch: arch.AMD64})
|
||||
@@ -186,8 +186,8 @@ done:
|
||||
}
|
||||
}
|
||||
|
||||
// TestEvexMaskingRecognised checks that masked EVEX forms — the .Z suffix and
|
||||
// an explicit K operand — are recognised and exempt from operand-count
|
||||
// TestEvexMaskingRecognised checks that masked EVEX forms; the .Z suffix and
|
||||
// an explicit K operand; are recognised and exempt from operand-count
|
||||
// checks.
|
||||
func TestEvexMaskingRecognised(t *testing.T) {
|
||||
diags := lintSrc(t, `
|
||||
@@ -284,7 +284,7 @@ TEXT ·f(SB), NOSPLIT|NOFRAME|DUPOK, $0
|
||||
}
|
||||
|
||||
func TestStackImbalance(t *testing.T) {
|
||||
// Function with frame size 16 but only SUB 8, SP — imbalance.
|
||||
// Function with frame size 16 but only SUB 8, SP; imbalance.
|
||||
diags := lintSrc(t, `
|
||||
#include "textflag.h"
|
||||
TEXT ·f(SB), NOSPLIT, $16-0
|
||||
@@ -297,7 +297,7 @@ TEXT ·f(SB), NOSPLIT, $16-0
|
||||
}
|
||||
|
||||
func TestStackBalanced(t *testing.T) {
|
||||
// Function with frame size 16 and matching SUB/ADD — balanced.
|
||||
// Function with frame size 16 and matching SUB/ADD; balanced.
|
||||
diags := lintSrc(t, `
|
||||
#include "textflag.h"
|
||||
TEXT ·f(SB), NOSPLIT, $16-0
|
||||
@@ -311,7 +311,7 @@ TEXT ·f(SB), NOSPLIT, $16-0
|
||||
}
|
||||
|
||||
func TestRegisterWidthMismatch(t *testing.T) {
|
||||
// MOVQ with 32-bit register — mismatch.
|
||||
// MOVQ with 32-bit register; mismatch.
|
||||
diags := lintSrc(t, `
|
||||
#include "textflag.h"
|
||||
TEXT ·f(SB), NOSPLIT, $0
|
||||
@@ -324,7 +324,7 @@ TEXT ·f(SB), NOSPLIT, $0
|
||||
}
|
||||
|
||||
func TestRegisterWidthCorrect(t *testing.T) {
|
||||
// MOVQ with 64-bit registers — correct.
|
||||
// MOVQ with 64-bit registers; correct.
|
||||
diags := lintSrc(t, `
|
||||
#include "textflag.h"
|
||||
TEXT ·f(SB), NOSPLIT, $0
|
||||
|
||||
@@ -7,13 +7,13 @@ import "testing"
|
||||
|
||||
// TestRegisterClobber checks the register-clobber audit is calibrated to the
|
||||
// Go ABI (cmd/compile/abi-internal.md), not the platform ABI: Go's
|
||||
// stack-based ABI0 — which hand-written assembly uses — has no System V
|
||||
// stack-based ABI0, which hand-written assembly uses, has no System V
|
||||
// style callee-saved registers, so argument and scratch registers may be
|
||||
// clobbered freely. Only the registers the ABI fixes across calls (the
|
||||
// frame pointer, the goroutine pointer, OS-reserved registers) are audited.
|
||||
func TestRegisterClobber(t *testing.T) {
|
||||
// amd64: BX, R12, R13 and R15 are argument/permanent-scratch registers in
|
||||
// Go ABI0 — writing them unsaved is legal (a System V calibration would
|
||||
// Go ABI0; writing them unsaved is legal (a System V calibration would
|
||||
// report all of these).
|
||||
scratch := lintSrc(t, "#include \"textflag.h\"\n"+
|
||||
"TEXT ·f(SB), NOSPLIT, $0\n"+
|
||||
@@ -27,7 +27,7 @@ func TestRegisterClobber(t *testing.T) {
|
||||
}
|
||||
|
||||
// amd64: R14 (the goroutine pointer) in a NOSPLIT function without calls
|
||||
// is the runtime's own pattern — the ABI0 transition restores it — so it
|
||||
// is the runtime's own pattern (the ABI0 transition restores it), so it
|
||||
// is not flagged.
|
||||
leaf := lintSrc(t, "#include \"textflag.h\"\n"+
|
||||
"TEXT ·f(SB), NOSPLIT, $0\n"+
|
||||
@@ -101,7 +101,7 @@ func TestRegisterClobber(t *testing.T) {
|
||||
t.Fatalf("arm64 R18 write should be flagged: %+v", armReserved)
|
||||
}
|
||||
|
||||
// riscv64: X27 holds the goroutine; X5–X7 are scratch.
|
||||
// riscv64: X27 holds the goroutine; X5-X7 are scratch.
|
||||
riscScratch := lintSrcArch(t, "t_riscv64.s", "#include \"textflag.h\"\n"+
|
||||
"TEXT ·f(SB), NOSPLIT, $0\n"+
|
||||
"\tMOV X5, X6\n"+
|
||||
@@ -117,7 +117,7 @@ func TestRegisterClobber(t *testing.T) {
|
||||
t.Fatalf("unsaved riscv64 X27 write should be flagged: %+v", riscG)
|
||||
}
|
||||
|
||||
// loong64: R22 holds the goroutine; R5–R19 are argument/scratch.
|
||||
// loong64: R22 holds the goroutine; R5-R19 are argument/scratch.
|
||||
loongScratch := lintSrcArch(t, "t_loong64.s", "#include \"textflag.h\"\n"+
|
||||
"TEXT ·f(SB), NOSPLIT, $0\n"+
|
||||
"\tMOVV R5, R6\n"+
|
||||
|
||||
Reference in New Issue
Block a user