-
Notifications
You must be signed in to change notification settings - Fork 17.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/internal/obj/riscv: prevent constant loads that do not target reg…
…isters Check that the target of a constant load is a register and add test coverage for this error condition. While here, rename the RISC-V testdata and tests to be consistent with other platforms. Change-Id: I7fd0bfcee8cf9df0597d72e65cd74a2d0bfd349a Reviewed-on: https://go-review.googlesource.com/c/go/+/292895 Trust: Joel Sing <joel@sing.id.au> Reviewed-by: Cherry Zhang <cherryyz@google.com> Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Go Bot <gobot@golang.org>
- Loading branch information
Showing
4 changed files
with
24 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters