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
7 # The following check prefixes are used in this test:
8 # CHECK-INST.....Match the canonical instr (tests alias to instr. mapping)
9 # CHECK-EXPAND...Match canonical instr. unconditionally (tests alias expansion)
11 # CHECK-EXPAND: c.li a0, 0
13 # CHECK-EXPAND: c.li a0, 1
15 # CHECK-EXPAND: c.li a0, -1
17 # CHECK-EXPAND: addi a0, zero, 2047
19 # CHECK-EXPAND: addi a0, zero, -2047
21 # CHECK-EXPAND: c.lui a1, 1
22 # CHECK-EXPAND: addi a1, a1, -2048
24 # CHECK-EXPAND: addi a1, zero, -2048
26 # CHECK-EXPAND: c.lui a1, 1
27 # CHECK-EXPAND: addi a1, a1, -2047
29 # CHECK-EXPAND: lui a1, 1048575
30 # CHECK-EXPAND: addi a1, a1, 2047
32 # CHECK-EXPAND: c.lui a1, 1
33 # CHECK-EXPAND: c.addi a1, -1
35 # CHECK-EXPAND: lui a1, 1048575
36 # CHECK-EXPAND: c.addi a1, 1
38 # CHECK-EXPAND: c.lui a2, 1
40 # CHECK-EXPAND: lui a2, 1048575
42 # CHECK-EXPAND: c.lui a2, 1
43 # CHECK-EXPAND: c.addi a2, 1
45 # CHECK-EXPAND: lui a2, 1048575
46 # CHECK-EXPAND: c.addi a2, -1
48 # CHECK-EXPAND: lui a2, 524288
49 # CHECK-EXPAND: c.addi a2, -1
51 # CHECK-EXPAND: lui a2, 524288
52 # CHECK-EXPAND: c.addi a2, 1
54 # CHECK-EXPAND: lui a2, 524288
56 # CHECK-EXPAND: lui a2, 524288
59 # CHECK-EXPAND: lui a2, 524288
61 # CHECK-EXPAND: c.li a2, -1
64 # CHECK-EXPAND: c.mv sp, sp