The following assembly code should issue two errors specifying that both jump and load offsets are out of range: if r1 > r2 goto +100500 r1 = *(u64 *)(r1 - 100500) This commit updates BPFAsmParser to check that: - offset specified for jump is either identifier (label) or a 16-bit signed constant; - offset specified for memory operations is a signed 16-bit constant. (Which matches expectations in the BPFELFObjectWriter and BPFMCCodeEmitter). Differential Revision: https://reviews.llvm.org/D158425
13 lines
280 B
ArmAsm
13 lines
280 B
ArmAsm
# RUN: llvm-mc -triple bpfel -filetype=obj < %s \
|
|
# RUN: | llvm-objdump --no-print-imm-hex --no-show-raw-insn -d - \
|
|
# RUN: | FileCheck %s
|
|
|
|
.equ foo, -1
|
|
if r1 > r2 goto foo + 2
|
|
exit
|
|
exit
|
|
|
|
# CHECK: if r1 > r2 goto +1
|
|
# CHECK: exit
|
|
# CHECK: exit
|