1 # RUN: llvm-mc %s -triple=riscv32 -mattr=+c -riscv-no-aliases -show-encoding \
2 # RUN: | FileCheck -check-prefixes=CHECK-ASM,CHECK-ASM-AND-OBJ %s
3 # RUN: llvm-mc %s -triple riscv64 -mattr=+c -riscv-no-aliases -show-encoding \
4 # RUN: | FileCheck -check-prefixes=CHECK-ASM,CHECK-ASM-AND-OBJ %s
5 # RUN: llvm-mc -filetype=obj -triple=riscv32 -mattr=+c < %s \
6 # RUN: | llvm-objdump -M no-aliases -d -r - \
7 # RUN: | FileCheck -check-prefixes=CHECK-OBJ,CHECK-ASM-AND-OBJ %s
8 # RUN: llvm-mc -filetype=obj -triple=riscv64 -mattr=+c < %s \
9 # RUN: | llvm-objdump -M no-aliases -d -r - \
10 # RUN: | FileCheck -check-prefixes=CHECK-OBJ,CHECK-ASM-AND-OBJ %s
12 # CHECK-ASM-AND-OBJ: c.nop 8
13 # CHECK-ASM: encoding: [0x21,0x00]
16 # CHECK-ASM: c.addi zero, 7
17 # CHECK-ASM: encoding: [0x1d,0x00]
21 # CHECK-ASM-AND-OBJ: c.addi a0, 0
22 # CHECK-ASM: encoding: [0x01,0x05]
25 # CHECK-ASM-AND-OBJ: c.li zero, 0
26 # CHECK-ASM: encoding: [0x01,0x40]
29 # CHECK-ASM-AND-OBJ: c.li zero, 1
30 # CHECK-ASM: encoding: [0x05,0x40]
33 # CHECK-ASM-AND-OBJ: c.lui zero, 1
34 # CHECK-ASM: encoding: [0x05,0x60]
37 # CHECK-ASM-AND-OBJ: c.mv zero, a0
38 # CHECK-ASM: encoding: [0x2a,0x80]
41 # CHECK-ASM-AND-OBJ: c.add zero, a0
42 # CHECK-ASM: encoding: [0x2a,0x90]
45 # CHECK-ASM-AND-OBJ: c.slli zero, 1
46 # CHECK-ASM: encoding: [0x06,0x00]
49 # CHECK-ASM-AND-OBJ: c.slli64 zero
50 # CHECK-ASM: encoding: [0x02,0x00]
53 # CHECK-ASM-AND-OBJ: c.slli64 a0
54 # CHECK-ASM: encoding: [0x02,0x05]
57 # CHECK-ASM-AND-OBJ: c.srli64 a1
58 # CHECK-ASM: encoding: [0x81,0x81]
61 # CHECK-ASM-AND-OBJ: c.srai64 a0
62 # CHECK-ASM: encoding: [0x01,0x85]