testEndToEnd(t, "ppc64", "ppc64")
}
-func TestRISCVEncoder(t *testing.T) {
- testEndToEnd(t, "riscv64", "riscvenc")
+func TestRISCVEndToEnd(t *testing.T) {
+ testEndToEnd(t, "riscv64", "riscv64")
+}
+
+func TestRISCVErrors(t *testing.T) {
+ testErrors(t, "riscv64", "riscv64error")
}
func TestS390XEndToEnd(t *testing.T) {
--- /dev/null
+// Copyright 2021 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+TEXT errors(SB),$0
+ MOV $0, 0(SP) // ERROR "constant load must target register"
+ MOV $0, 8(SP) // ERROR "constant load must target register"
+ MOV $1234, 0(SP) // ERROR "constant load must target register"
+ MOV $1234, 8(SP) // ERROR "constant load must target register"
+ MOVB $1, X5 // ERROR "unsupported constant load"
+ MOVH $1, X5 // ERROR "unsupported constant load"
+ MOVW $1, X5 // ERROR "unsupported constant load"
+ MOVF $1, X5 // ERROR "unsupported constant load"
+ RET
// LUI top20bits(c), R
// ADD bottom12bits(c), R, R
if p.As != AMOV {
- ctxt.Diag("unsupported constant load at %v", p)
+ ctxt.Diag("%v: unsupported constant load", p)
+ }
+ if p.To.Type != obj.TYPE_REG {
+ ctxt.Diag("%v: constant load must target register", p)
}
off := p.From.Offset
to := p.To