1 # RUN: llvm-mc -triple=riscv32 -mattr=+c -riscv-no-aliases < %s \
2 # RUN: | FileCheck -check-prefixes=CHECK-EXPAND,CHECK-INST %s
3 # RUN: llvm-mc -filetype=obj -triple riscv32 -mattr=+c < %s \
4 # RUN: | llvm-objdump -d -M no-aliases - \
5 # RUN: | FileCheck -check-prefixes=CHECK-EXPAND,CHECK-INST %s
6 # RUN: llvm-mc -triple=riscv32 -mattr=+zca -riscv-no-aliases < %s \
7 # RUN: | FileCheck -check-prefixes=CHECK-EXPAND,CHECK-INST %s
8 # RUN: llvm-mc -filetype=obj -triple riscv32 -mattr=+zca < %s \
9 # RUN: | llvm-objdump --mattr=+zca -d -M no-aliases - \
10 # RUN: | FileCheck -check-prefixes=CHECK-EXPAND,CHECK-INST %s
12 # The following check prefixes are used in this test:
13 # CHECK-INST.....Match the canonical instr (tests alias to instr. mapping)
14 # CHECK-EXPAND...Match canonical instr. unconditionally (tests alias expansion)
17 # CHECK-EXPAND: c.li a0, 0
19 # CHECK-EXPAND: c.li a0, 1
21 # CHECK-EXPAND: c.li a0, -1
23 # CHECK-EXPAND: addi a0, zero, 2047
25 # CHECK-EXPAND: addi a0, zero, -2047
27 # CHECK-EXPAND: c.li a1, 1
28 # CHECK-EXPAND: c.slli a1, 11
30 # CHECK-EXPAND: addi a1, zero, -2048
32 # CHECK-EXPAND: c.lui a1, 1
33 # CHECK-EXPAND: addi a1, a1, -2047
35 # CHECK-EXPAND: lui a1, 1048575
36 # CHECK-EXPAND: addi a1, a1, 2047
38 # CHECK-EXPAND: c.lui a1, 1
39 # CHECK-EXPAND: c.addi a1, -1
41 # CHECK-EXPAND: lui a1, 1048575
42 # CHECK-EXPAND: c.addi a1, 1
44 # CHECK-EXPAND: c.lui a2, 1
46 # CHECK-EXPAND: lui a2, 1048575
48 # CHECK-EXPAND: c.lui a2, 1
49 # CHECK-EXPAND: c.addi a2, 1
51 # CHECK-EXPAND: lui a2, 1048575
52 # CHECK-EXPAND: c.addi a2, -1
54 # CHECK-EXPAND: lui a2, 524288
55 # CHECK-EXPAND: c.addi a2, -1
57 # CHECK-EXPAND: lui a2, 524288
58 # CHECK-EXPAND: c.addi a2, 1
60 # CHECK-EXPAND: lui a2, 524288
62 # CHECK-EXPAND: lui a2, 524288
65 # CHECK-EXPAND: lui a2, 524288
67 # CHECK-EXPAND: c.li a2, -1
70 # CHECK-EXPAND: c.mv sp, sp