• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# RUN: llvm-mc %s -triple=riscv32 -mattr=+a -riscv-no-aliases \
2# RUN:     | FileCheck -check-prefixes=CHECK-S-NOALIAS,CHECK-S-OBJ-NOALIAS %s
3# RUN: llvm-mc %s -triple=riscv32 -mattr=+a \
4# RUN:     | FileCheck -check-prefixes=CHECK-S,CHECK-S-OBJ %s
5# RUN: llvm-mc %s -triple=riscv64 -mattr=+a -riscv-no-aliases\
6# RUN:     | FileCheck -check-prefixes=CHECK-S-NOALIAS,CHECK-S-OBJ-NOALIAS %s
7# RUN: llvm-mc %s -triple=riscv64 -mattr=+a \
8# RUN:     | FileCheck -check-prefixes=CHECK-S,CHECK-S-OBJ %s
9# RUN: llvm-mc -filetype=obj -triple riscv32 -mattr=+a < %s \
10# RUN:     | llvm-objdump -d --mattr=+a -M no-aliases - \
11# RUN:     | FileCheck -check-prefixes=CHECK-OBJ-NOALIAS,CHECK-S-OBJ-NOALIAS %s
12# RUN: llvm-mc -filetype=obj -triple riscv32 -mattr=+a < %s \
13# RUN:     | llvm-objdump -d --mattr=+a - \
14# RUN:     | FileCheck --check-prefix=CHECK-S-OBJ %s
15# RUN: llvm-mc -filetype=obj -triple riscv64 -mattr=+a < %s \
16# RUN:     | llvm-objdump -d --mattr=+a -M no-aliases - \
17# RUN:     | FileCheck -check-prefixes=CHECK-OBJ-NOALIAS,CHECK-S-OBJ-NOALIAS %s
18# RUN: llvm-mc -filetype=obj -triple riscv64 -mattr=+a < %s \
19# RUN:     | llvm-objdump -d --mattr=+a - \
20# RUN:     | FileCheck --check-prefix=CHECK-S-OBJ %s
21
22# The following check prefixes are used in this test:
23# CHECK-S                 Match the .s output with aliases enabled
24# CHECK-S-NOALIAS         Match the .s output with aliases disabled
25# CHECK-OBJ               Match the objdumped object output with aliases enabled
26# CHECK-OBJ-NOALIAS       Match the objdumped object output with aliases enabled
27# CHECK-S-OBJ             Match both the .s and objdumped object output with
28#                         aliases enabled
29# CHECK-S-OBJ-NOALIAS     Match both the .s and objdumped object output with
30#                         aliases disabled
31
32# The below tests for lr.w, sc.w and amo*.w, using `0(reg)` are actually
33# implemented using a custom parser, but we test them as if they're aliases.
34# CHECK-S: {{^}}
35# CHECK-S-NOALIAS: {{^}}
36# CHECK-OBJ-NOALIAS: {{^}}
37
38# CHECK-S-OBJ: lr.w a1, (a0)
39# CHECK-S-OBJ-NOALIAS: lr.w a1, (a0)
40lr.w a1, 0(a0)
41
42# CHECK-S-OBJ: lr.w.aq a1, (a0)
43# CHECK-S-OBJ-NOALIAS: lr.w.aq a1, (a0)
44lr.w.aq a1, 0(a0)
45
46# CHECK-S-OBJ: lr.w.rl a1, (a0)
47# CHECK-S-OBJ-NOALIAS: lr.w.rl a1, (a0)
48lr.w.rl a1, 0(a0)
49
50# CHECK-S-OBJ: lr.w.aqrl a1, (a0)
51# CHECK-S-OBJ-NOALIAS: lr.w.aqrl a1, (a0)
52lr.w.aqrl a1, 0(a0)
53
54# CHECK-S-OBJ: sc.w a2, a1, (a0)
55# CHECK-S-OBJ-NOALIAS: sc.w a2, a1, (a0)
56sc.w a2, a1, 0(a0)
57
58# CHECK-S-OBJ: sc.w.aq a2, a1, (a0)
59# CHECK-S-OBJ-NOALIAS: sc.w.aq a2, a1, (a0)
60sc.w.aq a2, a1, 0(a0)
61
62# CHECK-S-OBJ: sc.w.rl a2, a1, (a0)
63# CHECK-S-OBJ-NOALIAS: sc.w.rl a2, a1, (a0)
64sc.w.rl a2, a1, 0(a0)
65
66# CHECK-S-OBJ: sc.w.aqrl a2, a1, (a0)
67# CHECK-S-OBJ-NOALIAS: sc.w.aqrl a2, a1, (a0)
68sc.w.aqrl a2, a1, 0(a0)
69
70# CHECK-S-OBJ: amoswap.w a2, a1, (a0)
71# CHECK-S-OBJ-NOALIAS: amoswap.w a2, a1, (a0)
72amoswap.w a2, a1, 0(a0)
73
74# CHECK-S-OBJ: amoswap.w.aq a2, a1, (a0)
75# CHECK-S-OBJ-NOALIAS: amoswap.w.aq a2, a1, (a0)
76amoswap.w.aq a2, a1, 0(a0)
77
78# CHECK-S-OBJ: amoswap.w.rl a2, a1, (a0)
79# CHECK-S-OBJ-NOALIAS: amoswap.w.rl a2, a1, (a0)
80amoswap.w.rl a2, a1, 0(a0)
81
82# CHECK-S-OBJ: amoswap.w.aqrl a2, a1, (a0)
83# CHECK-S-OBJ-NOALIAS: amoswap.w.aqrl a2, a1, (a0)
84amoswap.w.aqrl a2, a1, 0(a0)
85
86# CHECK-S-OBJ: amoadd.w a2, a1, (a0)
87# CHECK-S-OBJ-NOALIAS: amoadd.w a2, a1, (a0)
88amoadd.w a2, a1, 0(a0)
89
90# CHECK-S-OBJ: amoadd.w.aq a2, a1, (a0)
91# CHECK-S-OBJ-NOALIAS: amoadd.w.aq a2, a1, (a0)
92amoadd.w.aq a2, a1, 0(a0)
93
94# CHECK-S-OBJ: amoadd.w.rl a2, a1, (a0)
95# CHECK-S-OBJ-NOALIAS: amoadd.w.rl a2, a1, (a0)
96amoadd.w.rl a2, a1, 0(a0)
97
98# CHECK-S-OBJ: amoadd.w.aqrl a2, a1, (a0)
99# CHECK-S-OBJ-NOALIAS: amoadd.w.aqrl a2, a1, (a0)
100amoadd.w.aqrl a2, a1, 0(a0)
101
102# CHECK-S-OBJ: amoxor.w a2, a1, (a0)
103# CHECK-S-OBJ-NOALIAS: amoxor.w a2, a1, (a0)
104amoxor.w a2, a1, 0(a0)
105
106# CHECK-S-OBJ: amoxor.w.aq a2, a1, (a0)
107# CHECK-S-OBJ-NOALIAS: amoxor.w.aq a2, a1, (a0)
108amoxor.w.aq a2, a1, 0(a0)
109
110# CHECK-S-OBJ: amoxor.w.rl a2, a1, (a0)
111# CHECK-S-OBJ-NOALIAS: amoxor.w.rl a2, a1, (a0)
112amoxor.w.rl a2, a1, 0(a0)
113
114# CHECK-S-OBJ: amoxor.w.aqrl a2, a1, (a0)
115# CHECK-S-OBJ-NOALIAS: amoxor.w.aqrl a2, a1, (a0)
116amoxor.w.aqrl a2, a1, 0(a0)
117
118# CHECK-S-OBJ: amoand.w a2, a1, (a0)
119# CHECK-S-OBJ-NOALIAS: amoand.w a2, a1, (a0)
120amoand.w a2, a1, 0(a0)
121
122# CHECK-S-OBJ: amoand.w.aq a2, a1, (a0)
123# CHECK-S-OBJ-NOALIAS: amoand.w.aq a2, a1, (a0)
124amoand.w.aq a2, a1, 0(a0)
125
126# CHECK-S-OBJ: amoand.w.rl a2, a1, (a0)
127# CHECK-S-OBJ-NOALIAS: amoand.w.rl a2, a1, (a0)
128amoand.w.rl a2, a1, 0(a0)
129
130# CHECK-S-OBJ: amoand.w.aqrl a2, a1, (a0)
131# CHECK-S-OBJ-NOALIAS: amoand.w.aqrl a2, a1, (a0)
132amoand.w.aqrl a2, a1, 0(a0)
133
134# CHECK-S-OBJ: amoor.w a2, a1, (a0)
135# CHECK-S-OBJ-NOALIAS: amoor.w a2, a1, (a0)
136amoor.w a2, a1, 0(a0)
137
138# CHECK-S-OBJ: amoor.w.aq a2, a1, (a0)
139# CHECK-S-OBJ-NOALIAS: amoor.w.aq a2, a1, (a0)
140amoor.w.aq a2, a1, 0(a0)
141
142# CHECK-S-OBJ: amoor.w.rl a2, a1, (a0)
143# CHECK-S-OBJ-NOALIAS: amoor.w.rl a2, a1, (a0)
144amoor.w.rl a2, a1, 0(a0)
145
146# CHECK-S-OBJ: amoor.w.aqrl a2, a1, (a0)
147# CHECK-S-OBJ-NOALIAS: amoor.w.aqrl a2, a1, (a0)
148amoor.w.aqrl a2, a1, 0(a0)
149
150# CHECK-S-OBJ: amomin.w a2, a1, (a0)
151# CHECK-S-OBJ-NOALIAS: amomin.w a2, a1, (a0)
152amomin.w a2, a1, 0(a0)
153
154# CHECK-S-OBJ: amomin.w.aq a2, a1, (a0)
155# CHECK-S-OBJ-NOALIAS: amomin.w.aq a2, a1, (a0)
156amomin.w.aq a2, a1, 0(a0)
157
158# CHECK-S-OBJ: amomin.w.rl a2, a1, (a0)
159# CHECK-S-OBJ-NOALIAS: amomin.w.rl a2, a1, (a0)
160amomin.w.rl a2, a1, 0(a0)
161
162# CHECK-S-OBJ: amomin.w.aqrl a2, a1, (a0)
163# CHECK-S-OBJ-NOALIAS: amomin.w.aqrl a2, a1, (a0)
164amomin.w.aqrl a2, a1, 0(a0)
165
166# CHECK-S-OBJ: amomax.w a2, a1, (a0)
167# CHECK-S-OBJ-NOALIAS: amomax.w a2, a1, (a0)
168amomax.w a2, a1, 0(a0)
169
170# CHECK-S-OBJ: amomax.w.aq a2, a1, (a0)
171# CHECK-S-OBJ-NOALIAS: amomax.w.aq a2, a1, (a0)
172amomax.w.aq a2, a1, 0(a0)
173
174# CHECK-S-OBJ: amomax.w.rl a2, a1, (a0)
175# CHECK-S-OBJ-NOALIAS: amomax.w.rl a2, a1, (a0)
176amomax.w.rl a2, a1, 0(a0)
177
178# CHECK-S-OBJ: amomax.w.aqrl a2, a1, (a0)
179# CHECK-S-OBJ-NOALIAS: amomax.w.aqrl a2, a1, (a0)
180amomax.w.aqrl a2, a1, 0(a0)
181
182# CHECK-S-OBJ: amominu.w a2, a1, (a0)
183# CHECK-S-OBJ-NOALIAS: amominu.w a2, a1, (a0)
184amominu.w a2, a1, 0(a0)
185
186# CHECK-S-OBJ: amominu.w.aq a2, a1, (a0)
187# CHECK-S-OBJ-NOALIAS: amominu.w.aq a2, a1, (a0)
188amominu.w.aq a2, a1, 0(a0)
189
190# CHECK-S-OBJ: amominu.w.rl a2, a1, (a0)
191# CHECK-S-OBJ-NOALIAS: amominu.w.rl a2, a1, (a0)
192amominu.w.rl a2, a1, 0(a0)
193
194# CHECK-S-OBJ: amominu.w.aqrl a2, a1, (a0)
195# CHECK-S-OBJ-NOALIAS: amominu.w.aqrl a2, a1, (a0)
196amominu.w.aqrl a2, a1, 0(a0)
197
198# CHECK-S-OBJ: amomaxu.w a2, a1, (a0)
199# CHECK-S-OBJ-NOALIAS: amomaxu.w a2, a1, (a0)
200amomaxu.w a2, a1, 0(a0)
201
202# CHECK-S-OBJ: amomaxu.w.aq a2, a1, (a0)
203# CHECK-S-OBJ-NOALIAS: amomaxu.w.aq a2, a1, (a0)
204amomaxu.w.aq a2, a1, 0(a0)
205
206# CHECK-S-OBJ: amomaxu.w.rl a2, a1, (a0)
207# CHECK-S-OBJ-NOALIAS: amomaxu.w.rl a2, a1, (a0)
208amomaxu.w.rl a2, a1, 0(a0)
209
210# CHECK-S-OBJ: amomaxu.w.aqrl a2, a1, (a0)
211# CHECK-S-OBJ-NOALIAS: amomaxu.w.aqrl a2, a1, (a0)
212amomaxu.w.aqrl a2, a1, 0(a0)
213