aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/asm
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/asm')
-rw-r--r--src/cmd/asm/internal/asm/testdata/riscvenc.s15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/cmd/asm/internal/asm/testdata/riscvenc.s b/src/cmd/asm/internal/asm/testdata/riscvenc.s
index 73f41dd877..21d1c40d9d 100644
--- a/src/cmd/asm/internal/asm/testdata/riscvenc.s
+++ b/src/cmd/asm/internal/asm/testdata/riscvenc.s
@@ -267,3 +267,18 @@ start:
MOVD 4(X5), F0 // 07b04200
MOVD F0, 4(X5) // 27b20200
MOVD F0, F1 // d3000022
+
+ // These jumps can get printed as jumps to 2 because they go to the
+ // second instruction in the function (the first instruction is an
+ // invisible stack pointer adjustment).
+ JMP start // JMP 2 // 6ff05fcd
+ JMP (X5) // 67800200
+ JMP 4(X5) // 67804200
+
+ // JMP and CALL to symbol are encoded as:
+ // AUIPC $0, TMP
+ // JALR $0, TMP
+ // with a R_RISCV_PCREL_ITYPE relocation - the linker resolves the
+ // real address and updates the immediates for both instructions.
+ CALL asmtest(SB) // 970f0000
+ JMP asmtest(SB) // 970f0000