Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / llvm / test / MC / RISCV / rv32c-aliases-valid.s
blobf76c29ffdf26c0ab95bde17518582b94f382fb8d
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)
15 # CHECK-INST: {{^}}
17 # CHECK-EXPAND: c.li a0, 0
18 li x10, 0
19 # CHECK-EXPAND: c.li a0, 1
20 li x10, 1
21 # CHECK-EXPAND: c.li a0, -1
22 li x10, -1
23 # CHECK-EXPAND: addi a0, zero, 2047
24 li x10, 2047
25 # CHECK-EXPAND: addi a0, zero, -2047
26 li x10, -2047
27 # CHECK-EXPAND: c.li a1, 1
28 # CHECK-EXPAND: c.slli a1, 11
29 li x11, 2048
30 # CHECK-EXPAND: addi a1, zero, -2048
31 li x11, -2048
32 # CHECK-EXPAND: c.lui a1, 1
33 # CHECK-EXPAND: addi a1, a1, -2047
34 li x11, 2049
35 # CHECK-EXPAND: lui a1, 1048575
36 # CHECK-EXPAND: addi a1, a1, 2047
37 li x11, -2049
38 # CHECK-EXPAND: c.lui a1, 1
39 # CHECK-EXPAND: c.addi a1, -1
40 li x11, 4095
41 # CHECK-EXPAND: lui a1, 1048575
42 # CHECK-EXPAND: c.addi a1, 1
43 li x11, -4095
44 # CHECK-EXPAND: c.lui a2, 1
45 li x12, 4096
46 # CHECK-EXPAND: lui a2, 1048575
47 li x12, -4096
48 # CHECK-EXPAND: c.lui a2, 1
49 # CHECK-EXPAND: c.addi a2, 1
50 li x12, 4097
51 # CHECK-EXPAND: lui a2, 1048575
52 # CHECK-EXPAND: c.addi a2, -1
53 li x12, -4097
54 # CHECK-EXPAND: lui a2, 524288
55 # CHECK-EXPAND: c.addi a2, -1
56 li x12, 2147483647
57 # CHECK-EXPAND: lui a2, 524288
58 # CHECK-EXPAND: c.addi a2, 1
59 li x12, -2147483647
60 # CHECK-EXPAND: lui a2, 524288
61 li x12, -2147483648
62 # CHECK-EXPAND: lui a2, 524288
63 li x12, -0x80000000
65 # CHECK-EXPAND: lui a2, 524288
66 li x12, 0x80000000
67 # CHECK-EXPAND: c.li a2, -1
68 li x12, 0xFFFFFFFF
70 # CHECK-EXPAND: c.mv sp, sp
71 addi x2, x2, 0