Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions llvm/lib/Target/BPF/AsmParser/BPFAsmParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,9 @@ bool BPFAsmParser::matchAndEmitInstruction(SMLoc IDLoc, unsigned &Opcode,
case Match_InvalidSImm16:
return Error(Operands[ErrorInfo]->getStartLoc(),
"operand is not a 16-bit signed integer");
case Match_InvalidTiedOperand:
return Error(Operands[ErrorInfo]->getStartLoc(),
"operand is not the same as the dst register");
}

llvm_unreachable("Unknown match type detected!");
Expand Down
12 changes: 12 additions & 0 deletions llvm/test/MC/BPF/bad-tied.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# RUN: not llvm-mc -mcpu=v4 -triple bpfel < %s 2>&1 \
# RUN: | grep 'error: operand is not the same as the dst register' \
# RUN: | count 9
r0 = bswap16 r1
r0 = bswap32 r1
r0 = bswap64 r1
r0 = atomic_fetch_add((u64*)(r2 + 0), r1)
r0 = atomic_fetch_and((u64*)(r2 + 0), r1)
r0 = atomic_fetch_or((u64*)(r2 + 0), r1)
r0 = atomic_fetch_xor((u64*)(r2 + 0), r1)
w0 = xchg32_32(r2 + 0, w1)
r0 = xchg_64(r2 + 0, r1)
Loading