1 # RUN: not llvm-mc -triple=riscv64 -mattr=+c < %s 2>&1 | FileCheck %s
4 c.
ld ra
, 4(sp
) # CHECK: :[[@LINE]]:6: error: invalid operand for instruction
5 c.sd sp
, 4(sp
) # CHECK: :[[@LINE]]:6: error: invalid operand for instruction
6 c.addw a0
, a7
# CHECK: :[[@LINE]]:14: error: invalid operand for instruction
7 c.subw a0
, a6
# CHECK: :[[@LINE]]:14: error: invalid operand for instruction
10 c.ldsp x0
, 4(sp
) # CHECK: :[[@LINE]]:9: error: invalid operand for instruction
11 c.ldsp zero
, 4(sp
) # CHECK: :[[@LINE]]:9: error: invalid operand for instruction
13 # Out of range immediates
15 ## uimmlog2xlennonzero
16 c.slli t0
, 64 # CHECK: :[[@LINE]]:12: error: immediate must be an integer in the range [1, 63]
17 c.srli a0
, -1 # CHECK: :[[@LINE]]:12: error: immediate must be an integer in the range [1, 63]
18 c.
srai a0
, 0 # CHECK: :[[@LINE]]:12: error: immediate must be an integer in the range [1, 63]
21 c.addiw t0
, -33 # CHECK: :[[@LINE]]:13: error: immediate must be an integer in the range [-32, 31]
22 c.addiw t0
, 32 # CHECK: :[[@LINE]]:13: error: immediate must be an integer in the range [-32, 31]
23 c.addiw t0
, foo
# CHECK: :[[@LINE]]:13: error: immediate must be an integer in the range [-32, 31]
24 c.addiw t0
, %lo
(foo
) # CHECK: :[[@LINE]]:13: error: immediate must be an integer in the range [-32, 31]
25 c.addiw t0
, %hi
(foo
) # CHECK: :[[@LINE]]:13: error: immediate must be an integer in the range [-32, 31]
28 c.ldsp ra
, 512(sp
) # CHECK: :[[@LINE]]:13: error: immediate must be a multiple of 8 bytes in the range [0, 504]
29 c.sdsp ra
, -8(sp
) # CHECK: :[[@LINE]]:13: error: immediate must be a multiple of 8 bytes in the range [0, 504]
31 c.
ld s0
, -8(sp
) # CHECK: :[[@LINE]]:11: error: immediate must be a multiple of 8 bytes in the range [0, 248]
32 c.sd s0
, 256(sp
) # CHECK: :[[@LINE]]:11: error: immediate must be a multiple of 8 bytes in the range [0, 248]