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)
12 # CHECK-EXPAND: c.li a0, 0
14 # CHECK-EXPAND: c.li a0, 1
16 # CHECK-EXPAND: c.li a0, -1
18 # CHECK-EXPAND: addi a0, zero, 2047
20 # CHECK-EXPAND: addi a0, zero, -2047
22 # CHECK-EXPAND: c.lui a1, 1
23 # CHECK-EXPAND: addi a1, a1, -2048
25 # CHECK-EXPAND: addi a1, zero, -2048
27 # CHECK-EXPAND: c.lui a1, 1
28 # CHECK-EXPAND: addi a1, a1, -2047
30 # CHECK-EXPAND: lui a1, 1048575
31 # CHECK-EXPAND: addi a1, a1, 2047
33 # CHECK-EXPAND: c.lui a1, 1
34 # CHECK-EXPAND: c.addi a1, -1
36 # CHECK-EXPAND: lui a1, 1048575
37 # CHECK-EXPAND: c.addi a1, 1
39 # CHECK-EXPAND: c.lui a2, 1
41 # CHECK-EXPAND: lui a2, 1048575
43 # CHECK-EXPAND: c.lui a2, 1
44 # CHECK-EXPAND: c.addi a2, 1
46 # CHECK-EXPAND: lui a2, 1048575
47 # CHECK-EXPAND: c.addi a2, -1
49 # CHECK-EXPAND: lui a2, 524288
50 # CHECK-EXPAND: c.addi a2, -1
52 # CHECK-EXPAND: lui a2, 524288
53 # CHECK-EXPAND: c.addi a2, 1
55 # CHECK-EXPAND: lui a2, 524288
57 # CHECK-EXPAND: lui a2, 524288
60 # CHECK-EXPAND: lui a2, 524288
62 # CHECK-EXPAND: c.li a2, -1
65 # CHECK-EXPAND: c.mv sp, sp