1 # RUN: not llvm-mc %s -triple=riscv32 2>&1 | FileCheck %s
2 # RUN: not llvm-mc %s -triple=riscv64 2>&1 | FileCheck %s
4 # The below tests for lr(.w), sc(.w) and amo*(.w), using `0(reg)` are actually
5 # implemented using a custom parser. These tests ensure the custom parser gives
8 lr.w a1
, a0
# CHECK: :[[@LINE]]:10: error: expected '(' or optional integer offset
9 lr.w a1
, foo
# CHECK: :[[@LINE]]:10: error: expected '(' or optional integer offset
10 lr.w a1
, 1(a0
) # CHECK: :[[@LINE]]:10: error: optional integer offset must be 0
11 lr.w a1
, (foo
) # CHECK: :[[@LINE]]:11: error: expected register
12 lr.w a1
, 0(foo
) # CHECK: :[[@LINE]]:12: error: expected register
13 lr.w a1
, (f0) # CHECK: :[[@LINE]]:11: error: invalid operand for instruction
14 lr.w a1
, 0(f0) # CHECK: :[[@LINE]]:12: error: invalid operand for instruction
15 lr.w a1
, 0(a0
# CHECK: :[[@LINE]]:17: error: expected ')'
16 lr.w a1
, (a0
# CHECK: :[[@LINE]]:17: error: expected ')'
18 sc.w a2
, a1
, a0
# CHECK: :[[@LINE]]:14: error: expected '(' or optional integer offset
19 sc.w a2
, a1
, foo
# CHECK: :[[@LINE]]:14: error: expected '(' or optional integer offset
20 sc.w a2
, a1
, 1(a0
) # CHECK: :[[@LINE]]:14: error: optional integer offset must be 0
21 sc.w a2
, a1
, (foo
) # CHECK: :[[@LINE]]:15: error: expected register
22 sc.w a2
, a1
, 0(foo
) # CHECK: :[[@LINE]]:16: error: expected register
23 sc.w a2
, a1
, (f0) # CHECK: :[[@LINE]]:15: error: invalid operand for instruction
24 sc.w a2
, a1
, 0(f0) # CHECK: :[[@LINE]]:16: error: invalid operand for instruction
25 sc.w a2
, a1
, 0(a0
# CHECK: :[[@LINE]]:21: error: expected ')'
26 sc.w a2
, a1
, (a0
# CHECK: :[[@LINE]]:21: error: expected ')'
28 amoswap.w a2
, a1
, a0
# CHECK: :[[@LINE]]:19: error: expected '(' or optional integer offset
29 amoswap.w a2
, a1
, foo
# CHECK: :[[@LINE]]:19: error: expected '(' or optional integer offset
30 amoswap.w a2
, a1
, 1(a0
) # CHECK: :[[@LINE]]:19: error: optional integer offset must be 0
31 amoswap.w a2
, a1
, (foo
) # CHECK: :[[@LINE]]:20: error: expected register
32 amoswap.w a2
, a1
, 0(foo
) # CHECK: :[[@LINE]]:21: error: expected register
33 amoswap.w a2
, a1
, (f0) # CHECK: :[[@LINE]]:20: error: invalid operand for instruction
34 amoswap.w a2
, a1
, 0(f0) # CHECK: :[[@LINE]]:21: error: invalid operand for instruction
35 amoswap.w a2
, a1
, 0(a0
# CHECK: :[[@LINE]]:26: error: expected ')'
36 amoswap.w a2
, a1
, (a0
# CHECK: :[[@LINE]]:26: error: expected ')'
38 amoadd.w a2
, a1
, a0
# CHECK: :[[@LINE]]:18: error: expected '(' or optional integer offset
39 amoadd.w a2
, a1
, foo
# CHECK: :[[@LINE]]:18: error: expected '(' or optional integer offset
40 amoadd.w a2
, a1
, 1(a0
) # CHECK: :[[@LINE]]:18: error: optional integer offset must be 0
41 amoadd.w a2
, a1
, (foo
) # CHECK: :[[@LINE]]:19: error: expected register
42 amoadd.w a2
, a1
, 0(foo
) # CHECK: :[[@LINE]]:20: error: expected register
43 amoadd.w a2
, a1
, (f0) # CHECK: :[[@LINE]]:19: error: invalid operand for instruction
44 amoadd.w a2
, a1
, 0(f0) # CHECK: :[[@LINE]]:20: error: invalid operand for instruction
45 amoadd.w a2
, a1
, 0(a0
# CHECK: :[[@LINE]]:25: error: expected ')'
46 amoadd.w a2
, a1
, (a0
# CHECK: :[[@LINE]]:25: error: expected ')'
48 amoxor.w a2
, a1
, a0
# CHECK: :[[@LINE]]:18: error: expected '(' or optional integer offset
49 amoxor.w a2
, a1
, foo
# CHECK: :[[@LINE]]:18: error: expected '(' or optional integer offset
50 amoxor.w a2
, a1
, 1(a0
) # CHECK: :[[@LINE]]:18: error: optional integer offset must be 0
51 amoxor.w a2
, a1
, (foo
) # CHECK: :[[@LINE]]:19: error: expected register
52 amoxor.w a2
, a1
, 0(foo
) # CHECK: :[[@LINE]]:20: error: expected register
53 amoxor.w a2
, a1
, (f0) # CHECK: :[[@LINE]]:19: error: invalid operand for instruction
54 amoxor.w a2
, a1
, 0(f0) # CHECK: :[[@LINE]]:20: error: invalid operand for instruction
55 amoxor.w a2
, a1
, 0(a0
# CHECK: :[[@LINE]]:25: error: expected ')'
56 amoxor.w a2
, a1
, (a0
# CHECK: :[[@LINE]]:25: error: expected ')'
58 amoand.w a2
, a1
, a0
# CHECK: :[[@LINE]]:18: error: expected '(' or optional integer offset
59 amoand.w a2
, a1
, foo
# CHECK: :[[@LINE]]:18: error: expected '(' or optional integer offset
60 amoand.w a2
, a1
, 1(a0
) # CHECK: :[[@LINE]]:18: error: optional integer offset must be 0
61 amoand.w a2
, a1
, (foo
) # CHECK: :[[@LINE]]:19: error: expected register
62 amoand.w a2
, a1
, 0(foo
) # CHECK: :[[@LINE]]:20: error: expected register
63 amoand.w a2
, a1
, (f0) # CHECK: :[[@LINE]]:19: error: invalid operand for instruction
64 amoand.w a2
, a1
, 0(f0) # CHECK: :[[@LINE]]:20: error: invalid operand for instruction
65 amoand.w a2
, a1
, 0(a0
# CHECK: :[[@LINE]]:25: error: expected ')'
66 amoand.w a2
, a1
, (a0
# CHECK: :[[@LINE]]:25: error: expected ')'
68 amoor.w a2
, a1
, a0
# CHECK: :[[@LINE]]:17: error: expected '(' or optional integer offset
69 amoor.w a2
, a1
, foo
# CHECK: :[[@LINE]]:17: error: expected '(' or optional integer offset
70 amoor.w a2
, a1
, 1(a0
) # CHECK: :[[@LINE]]:17: error: optional integer offset must be 0
71 amoor.w a2
, a1
, (foo
) # CHECK: :[[@LINE]]:18: error: expected register
72 amoor.w a2
, a1
, 0(foo
) # CHECK: :[[@LINE]]:19: error: expected register
73 amoor.w a2
, a1
, (f0) # CHECK: :[[@LINE]]:18: error: invalid operand for instruction
74 amoor.w a2
, a1
, 0(f0) # CHECK: :[[@LINE]]:19: error: invalid operand for instruction
75 amoor.w a2
, a1
, 0(a0
# CHECK: :[[@LINE]]:24: error: expected ')'
76 amoor.w a2
, a1
, (a0
# CHECK: :[[@LINE]]:24: error: expected ')'
78 amomin.w a2
, a1
, a0
# CHECK: :[[@LINE]]:18: error: expected '(' or optional integer offset
79 amomin.w a2
, a1
, foo
# CHECK: :[[@LINE]]:18: error: expected '(' or optional integer offset
80 amomin.w a2
, a1
, 1(a0
) # CHECK: :[[@LINE]]:18: error: optional integer offset must be 0
81 amomin.w a2
, a1
, (foo
) # CHECK: :[[@LINE]]:19: error: expected register
82 amomin.w a2
, a1
, 0(foo
) # CHECK: :[[@LINE]]:20: error: expected register
83 amomin.w a2
, a1
, (f0) # CHECK: :[[@LINE]]:19: error: invalid operand for instruction
84 amomin.w a2
, a1
, 0(f0) # CHECK: :[[@LINE]]:20: error: invalid operand for instruction
85 amomin.w a2
, a1
, 0(a0
# CHECK: :[[@LINE]]:25: error: expected ')'
86 amomin.w a2
, a1
, (a0
# CHECK: :[[@LINE]]:25: error: expected ')'
88 amomax.w a2
, a1
, a0
# CHECK: :[[@LINE]]:18: error: expected '(' or optional integer offset
89 amomax.w a2
, a1
, foo
# CHECK: :[[@LINE]]:18: error: expected '(' or optional integer offset
90 amomax.w a2
, a1
, 1(a0
) # CHECK: :[[@LINE]]:18: error: optional integer offset must be 0
91 amomax.w a2
, a1
, (foo
) # CHECK: :[[@LINE]]:19: error: expected register
92 amomax.w a2
, a1
, 0(foo
) # CHECK: :[[@LINE]]:20: error: expected register
93 amomax.w a2
, a1
, (f0) # CHECK: :[[@LINE]]:19: error: invalid operand for instruction
94 amomax.w a2
, a1
, 0(f0) # CHECK: :[[@LINE]]:20: error: invalid operand for instruction
95 amomax.w a2
, a1
, 0(a0
# CHECK: :[[@LINE]]:25: error: expected ')'
96 amomax.w a2
, a1
, (a0
# CHECK: :[[@LINE]]:25: error: expected ')'
98 amominu.w a2
, a1
, a0
# CHECK: :[[@LINE]]:19: error: expected '(' or optional integer offset
99 amominu.w a2
, a1
, foo
# CHECK: :[[@LINE]]:19: error: expected '(' or optional integer offset
100 amominu.w a2
, a1
, 1(a0
) # CHECK: :[[@LINE]]:19: error: optional integer offset must be 0
101 amominu.w a2
, a1
, (foo
) # CHECK: :[[@LINE]]:20: error: expected register
102 amominu.w a2
, a1
, 0(foo
) # CHECK: :[[@LINE]]:21: error: expected register
103 amominu.w a2
, a1
, (f0) # CHECK: :[[@LINE]]:20: error: invalid operand for instruction
104 amominu.w a2
, a1
, 0(f0) # CHECK: :[[@LINE]]:21: error: invalid operand for instruction
105 amominu.w a2
, a1
, 0(a0
# CHECK: :[[@LINE]]:26: error: expected ')'
106 amominu.w a2
, a1
, (a0
# CHECK: :[[@LINE]]:26: error: expected ')'
108 amomaxu.w a2
, a1
, a0
# CHECK: :[[@LINE]]:19: error: expected '(' or optional integer offset
109 amomaxu.w a2
, a1
, foo
# CHECK: :[[@LINE]]:19: error: expected '(' or optional integer offset
110 amomaxu.w a2
, a1
, 1(a0
) # CHECK: :[[@LINE]]:19: error: optional integer offset must be 0
111 amomaxu.w a2
, a1
, (foo
) # CHECK: :[[@LINE]]:20: error: expected register
112 amomaxu.w a2
, a1
, 0(foo
) # CHECK: :[[@LINE]]:21: error: expected register
113 amomaxu.w a2
, a1
, (f0) # CHECK: :[[@LINE]]:20: error: invalid operand for instruction
114 amomaxu.w a2
, a1
, 0(f0) # CHECK: :[[@LINE]]:21: error: invalid operand for instruction
115 amomaxu.w a2
, a1
, 0(a0
# CHECK: :[[@LINE]]:26: error: expected ')'
116 amomaxu.w a2
, a1
, (a0
# CHECK: :[[@LINE]]:26: error: expected ')'