1 # RUN: llvm-mc %s -triple=riscv32 -mattr=+f,+c -riscv-no-aliases -show-encoding \
2 # RUN: | FileCheck -check-prefix=CHECK-ASM %s
3 # RUN: llvm-mc %s -triple riscv64 -mattr=+f,+c -riscv-no-aliases -show-encoding \
4 # RUN: | FileCheck -check-prefix=CHECK-ASM %s
5 # RUN: llvm-mc -filetype=obj -triple=riscv32 -mattr=+f,+c < %s \
6 # RUN: | llvm-objdump --mattr=+f,+c -M no-aliases -d -r - \
7 # RUN: | FileCheck -check-prefix=CHECK-OBJ %s
8 # RUN: llvm-mc -filetype=obj -triple=riscv64 -mattr=+f,+c < %s \
9 # RUN: | llvm-objdump --mattr=+f,+c -M no-aliases -d -r - \
10 # RUN: | FileCheck -check-prefix=CHECK-OBJ %s
14 # CHECK-ASM: .insn cr 2, 9, a0, a1
15 # CHECK-ASM: encoding: [0x2e,0x95]
16 # CHECK-OBJ: c.add a0, a1
19 # CHECK-ASM: .insn cr 2, 9, a0, a1
20 # CHECK-ASM: encoding: [0x2e,0x95]
21 # CHECK-OBJ: c.add a0, a1
22 .insn cr C2, 9, a0, a1
24 # CHECK-ASM: .insn ci 1, 0, a0, 13
25 # CHECK-ASM: encoding: [0x35,0x05]
26 # CHECK-OBJ: c.addi a0, 13
29 # CHECK-ASM: .insn ci 1, 0, a0, 13
30 # CHECK-ASM: encoding: [0x35,0x05]
31 # CHECK-OBJ: c.addi a0, 13
32 .insn ci C1, 0, a0, 13
34 # CHECK-ASM: .insn ciw 0, 0, a0, 13
35 # CHECK-ASM: encoding: [0xa8,0x01]
36 # CHECK-OBJ: c.addi4spn a0, sp, 200
37 .insn ciw 0, 0, a0, 13
39 # CHECK-ASM: .insn ciw 0, 0, a0, 13
40 # CHECK-ASM: encoding: [0xa8,0x01]
41 # CHECK-OBJ: c.addi4spn a0, sp, 200
42 .insn ciw C0, 0, a0, 13
44 # CHECK-ASM: .insn css 2, 6, a0, 13
45 # CHECK-ASM: encoding: [0xaa,0xc6]
46 # CHECK-OBJ: c.swsp a0, 76(sp)
47 .insn css 2, 6, a0, 13
49 # CHECK-ASM: .insn cl 0, 2, a0, 13
50 # CHECK-ASM: encoding: [0xa8,0x4d]
51 # CHECK-OBJ: c.lw a0, 88(a1)
52 .insn cl 0, 2, a0, 13(a1)
54 # CHECK-ASM: .insn cs 0, 6, a0, 13
55 # CHECK-ASM: encoding: [0xa8,0xcd]
56 # CHECK-OBJ: c.sw a0, 88(a1)
57 .insn cs 0, 6, a0, 13(a1)
59 # CHECK-ASM: .insn ca 1, 35, 0, a0, a1
60 # CHECK-ASM: encoding: [0x0d,0x8d]
61 # CHECK-OBJ: c.sub a0, a1
62 .insn ca 1, 35, 0, a0, a1
64 # CHECK-ASM: .insn cb 1, 6, a0, target
65 # CHECK-ASM: encoding: [0x01'A',0xc1'A']
66 # CHECK-OBJ: c.beqz a0, 0x0 <target>
67 .insn cb 1, 6, a0, target
69 # CHECK-ASM: .insn cj 1, 5, target
70 # CHECK-ASM: encoding: [0bAAAAAA01,0b101AAAAA]
71 # CHECK-OBJ: c.j 0x0 <target>