xref: /llvm-project/llvm/test/MC/RISCV/fixups-invalid.s (revision 544535976df69c9244d72a1a5a31970ca2c1a15f)
1# RUN: not llvm-mc -filetype=obj %s -triple=riscv32 -o /dev/null 2>&1 \
2# RUN:     | FileCheck %s
3# RUN: not llvm-mc -filetype=obj %s -triple=riscv64 -o /dev/null 2>&1 \
4# RUN:     | FileCheck %s
5
6.byte foo   # CHECK: [[@LINE]]:7: error: 1-byte data relocations not supported
7.2byte foo  # CHECK: [[@LINE]]:8: error: 2-byte data relocations not supported
8
9# Test that using li with a symbol difference constant rejects values that
10# cannot fit in a signed 12-bit integer.
11.Lbuf: .skip (1 << 11)
12.Lbuf_end:
13.equ CONST, .Lbuf_end - .Lbuf
14# CHECK: error: operand must be a constant 12-bit integer
15li a0, CONST
16# CHECK: error: operand must be a constant 12-bit integer
17li a0, .Lbuf_end - .Lbuf
18