xref: /llvm-project/llvm/test/MC/RISCV/corev/XCVbi-invalid.s (revision afb9c04a5a44e62f945cd2f667706ded9facd8e3)
1# RUN: not llvm-mc -triple=riscv32 --mattr=+xcvbi %s 2>&1 \
2# RUN:        | FileCheck %s --check-prefixes=CHECK-ERROR
3
4//===----------------------------------------------------------------------===//
5// cv.beqimm
6//===----------------------------------------------------------------------===//
7
8cv.beqimm 0, 0, 0
9# CHECK-ERROR: invalid operand for instruction
10
11cv.beqimm t0, t1, 0
12# CHECK-ERROR: immediate must be an integer in the range [-16, 15]
13
14cv.beqimm t0, 0, t1
15# CHECK-ERROR: immediate must be a multiple of 2 bytes in the range [-4096, 4094]
16
17cv.beqimm t0, 16, 0
18# CHECK-ERROR: immediate must be an integer in the range [-16, 15]
19
20cv.beqimm t0, -17, 0
21# CHECK-ERROR: immediate must be an integer in the range [-16, 15]
22
23cv.beqimm t0, 0, 1
24# CHECK-ERROR: immediate must be a multiple of 2 bytes in the range [-4096, 4094]
25
26cv.beqimm t0, 0, 4096
27# CHECK-ERROR: immediate must be a multiple of 2 bytes in the range [-4096, 4094]
28
29cv.beqimm t0, 0, -4098
30# CHECK-ERROR: immediate must be a multiple of 2 bytes in the range [-4096, 4094]
31
32//===----------------------------------------------------------------------===//
33// cv.bneimm
34//===----------------------------------------------------------------------===//
35
36cv.bneimm 0, 0, 0
37# CHECK-ERROR: invalid operand for instruction
38
39cv.bneimm t0, t1, 0
40# CHECK-ERROR: immediate must be an integer in the range [-16, 15]
41
42cv.bneimm t0, 0, t1
43# CHECK-ERROR: immediate must be a multiple of 2 bytes in the range [-4096, 4094]
44
45cv.bneimm t0, 16, 0
46# CHECK-ERROR: immediate must be an integer in the range [-16, 15]
47
48cv.bneimm t0, -17, 0
49# CHECK-ERROR: immediate must be an integer in the range [-16, 15]
50
51cv.bneimm t0, 0, 1
52# CHECK-ERROR: immediate must be a multiple of 2 bytes in the range [-4096, 4094]
53
54cv.bneimm t0, 0, 4096
55# CHECK-ERROR: immediate must be a multiple of 2 bytes in the range [-4096, 4094]
56
57cv.bneimm t0, 0, -4098
58# CHECK-ERROR: immediate must be a multiple of 2 bytes in the range [-4096, 4094]