[MIParser] Set RegClassOrRegBank during instruction parsing
[llvm-complete.git] / test / MC / RISCV / rv64c-aliases-valid.s
blob996aa096059e01062d7016ffc5e92888f52ffcab
1 # RUN: llvm-mc -triple=riscv64 -mattr=+c -riscv-no-aliases < %s \
2 # RUN: | FileCheck -check-prefixes=CHECK-EXPAND,CHECK-INST %s
3 # RUN: llvm-mc -filetype=obj -triple riscv64 -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
12 li x10, 0
13 # CHECK-EXPAND: c.li a0, 1
14 li x10, 1
15 # CHECK-EXPAND: c.li a0, -1
16 li x10, -1
17 # CHECK-EXPAND: addi a0, zero, 2047
18 li x10, 2047
19 # CHECK-EXPAND: addi a0, zero, -2047
20 li x10, -2047
21 # CHECK-EXPAND: c.lui a1, 1
22 # CHECK-EXPAND: addiw a1, a1, -2048
23 li x11, 2048
24 # CHECK-EXPAND: addi a1, zero, -2048
25 li x11, -2048
26 # CHECK-EXPAND: c.lui a1, 1
27 # CHECK-EXPAND: addiw a1, a1, -2047
28 li x11, 2049
29 # CHECK-EXPAND: c.lui a1, 1048575
30 # CHECK-EXPAND: addiw a1, a1, 2047
31 li x11, -2049
32 # CHECK-EXPAND: c.lui a1, 1
33 # CHECK-EXPAND: c.addiw a1, -1
34 li x11, 4095
35 # CHECK-EXPAND: lui a1, 1048575
36 # CHECK-EXPAND: c.addiw a1, 1
37 li x11, -4095
38 # CHECK-EXPAND: c.lui a2, 1
39 li x12, 4096
40 # CHECK-EXPAND: lui a2, 1048575
41 li x12, -4096
42 # CHECK-EXPAND: c.lui a2, 1
43 # CHECK-EXPAND: c.addiw a2, 1
44 li x12, 4097
45 # CHECK-EXPAND: lui a2, 1048575
46 # CHECK-EXPAND: c.addiw a2, -1
47 li x12, -4097
48 # CHECK-EXPAND: lui a2, 524288
49 # CHECK-EXPAND: c.addiw a2, -1
50 li x12, 2147483647
51 # CHECK-EXPAND: lui a2, 524288
52 # CHECK-EXPAND: c.addiw a2, 1
53 li x12, -2147483647
54 # CHECK-EXPAND: lui a2, 524288
55 li x12, -2147483648
56 # CHECK-EXPAND: lui a2, 524288
57 li x12, -0x80000000
59 # CHECK-EXPAND: c.li a2, 1
60 # CHECK-EXPAND: c.slli a2, 31
61 li x12, 0x80000000
62 # CHECK-EXPAND: c.li a2, 1
63 # CHECK-EXPAND: c.slli a2, 32
64 # CHECK-EXPAND: c.addi a2, -1
65 li x12, 0xFFFFFFFF
67 # CHECK-EXPAND: c.li t0, 1
68 # CHECK-EXPAND: c.slli t0, 32
69 li t0, 0x100000000
70 # CHECK-EXPAND: c.li t1, -1
71 # CHECK-EXPAND: c.slli t1, 63
72 li t1, 0x8000000000000000
73 # CHECK-EXPAND: c.li t1, -1
74 # CHECK-EXPAND: c.slli t1, 63
75 li t1, -0x8000000000000000
76 # CHECK-EXPAND: lui t2, 9321
77 # CHECK-EXPAND: addiw t2, t2, -1329
78 # CHECK-EXPAND: c.slli t2, 35
79 li t2, 0x1234567800000000
80 # CHECK-EXPAND: c.li t3, 7
81 # CHECK-EXPAND: c.slli t3, 36
82 # CHECK-EXPAND: c.addi t3, 11
83 # CHECK-EXPAND: c.slli t3, 24
84 # CHECK-EXPAND: c.addi t3, 15
85 li t3, 0x700000000B00000F
86 # CHECK-EXPAND: lui t4, 583
87 # CHECK-EXPAND: addiw t4, t4, -1875
88 # CHECK-EXPAND: c.slli t4, 14
89 # CHECK-EXPAND: addi t4, t4, -947
90 # CHECK-EXPAND: c.slli t4, 12
91 # CHECK-EXPAND: addi t4, t4, 1511
92 # CHECK-EXPAND: c.slli t4, 13
93 # CHECK-EXPAND: addi t4, t4, -272
94 li t4, 0x123456789abcdef0
95 # CHECK-EXPAND: c.li t5, -1
96 li t5, 0xFFFFFFFFFFFFFFFF
98 # CHECK-EXPAND: c.ld s0, 0(s1)
99 c.ld x8, (x9)
100 # CHECK-EXPAND: c.sd s0, 0(s1)
101 c.sd x8, (x9)
102 # CHECK-EXPAND: c.ldsp s0, 0(sp)
103 c.ldsp x8, (x2)
104 # CHECK-EXPAND: c.sdsp s0, 0(sp)
105 c.sdsp x8, (x2)