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
, 0(a0
# CHECK: :[[@LINE]]:17: error: expected ')'
14 lr.w a1
, (a0
# CHECK: :[[@LINE]]:17: error: expected ')'
16 sc.w a2
, a1
, a0
# CHECK: :[[@LINE]]:14: error: expected '(' or optional integer offset
17 sc.w a2
, a1
, foo
# CHECK: :[[@LINE]]:14: error: expected '(' or optional integer offset
18 sc.w a2
, a1
, 1(a0
) # CHECK: :[[@LINE]]:14: error: optional integer offset must be 0
19 sc.w a2
, a1
, (foo
) # CHECK: :[[@LINE]]:15: error: expected register
20 sc.w a2
, a1
, 0(foo
) # CHECK: :[[@LINE]]:16: error: expected register
21 sc.w a2
, a1
, 0(a0
# CHECK: :[[@LINE]]:21: error: expected ')'
22 sc.w a2
, a1
, (a0
# CHECK: :[[@LINE]]:21: error: expected ')'
24 amoswap.w a2
, a1
, a0
# CHECK: :[[@LINE]]:19: error: expected '(' or optional integer offset
25 amoswap.w a2
, a1
, foo
# CHECK: :[[@LINE]]:19: error: expected '(' or optional integer offset
26 amoswap.w a2
, a1
, 1(a0
) # CHECK: :[[@LINE]]:19: error: optional integer offset must be 0
27 amoswap.w a2
, a1
, (foo
) # CHECK: :[[@LINE]]:20: error: expected register
28 amoswap.w a2
, a1
, 0(foo
) # CHECK: :[[@LINE]]:21: error: expected register
29 amoswap.w a2
, a1
, 0(a0
# CHECK: :[[@LINE]]:26: error: expected ')'
30 amoswap.w a2
, a1
, (a0
# CHECK: :[[@LINE]]:26: error: expected ')'
32 amoadd.w a2
, a1
, a0
# CHECK: :[[@LINE]]:18: error: expected '(' or optional integer offset
33 amoadd.w a2
, a1
, foo
# CHECK: :[[@LINE]]:18: error: expected '(' or optional integer offset
34 amoadd.w a2
, a1
, 1(a0
) # CHECK: :[[@LINE]]:18: error: optional integer offset must be 0
35 amoadd.w a2
, a1
, (foo
) # CHECK: :[[@LINE]]:19: error: expected register
36 amoadd.w a2
, a1
, 0(foo
) # CHECK: :[[@LINE]]:20: error: expected register
37 amoadd.w a2
, a1
, 0(a0
# CHECK: :[[@LINE]]:25: error: expected ')'
38 amoadd.w a2
, a1
, (a0
# CHECK: :[[@LINE]]:25: error: expected ')'
40 amoxor.w a2
, a1
, a0
# CHECK: :[[@LINE]]:18: error: expected '(' or optional integer offset
41 amoxor.w a2
, a1
, foo
# CHECK: :[[@LINE]]:18: error: expected '(' or optional integer offset
42 amoxor.w a2
, a1
, 1(a0
) # CHECK: :[[@LINE]]:18: error: optional integer offset must be 0
43 amoxor.w a2
, a1
, (foo
) # CHECK: :[[@LINE]]:19: error: expected register
44 amoxor.w a2
, a1
, 0(foo
) # CHECK: :[[@LINE]]:20: error: expected register
45 amoxor.w a2
, a1
, 0(a0
# CHECK: :[[@LINE]]:25: error: expected ')'
46 amoxor.w a2
, a1
, (a0
# CHECK: :[[@LINE]]:25: error: expected ')'
48 amoand.w a2
, a1
, a0
# CHECK: :[[@LINE]]:18: error: expected '(' or optional integer offset
49 amoand.w a2
, a1
, foo
# CHECK: :[[@LINE]]:18: error: expected '(' or optional integer offset
50 amoand.w a2
, a1
, 1(a0
) # CHECK: :[[@LINE]]:18: error: optional integer offset must be 0
51 amoand.w a2
, a1
, (foo
) # CHECK: :[[@LINE]]:19: error: expected register
52 amoand.w a2
, a1
, 0(foo
) # CHECK: :[[@LINE]]:20: error: expected register
53 amoand.w a2
, a1
, 0(a0
# CHECK: :[[@LINE]]:25: error: expected ')'
54 amoand.w a2
, a1
, (a0
# CHECK: :[[@LINE]]:25: error: expected ')'
56 amoor.w a2
, a1
, a0
# CHECK: :[[@LINE]]:17: error: expected '(' or optional integer offset
57 amoor.w a2
, a1
, foo
# CHECK: :[[@LINE]]:17: error: expected '(' or optional integer offset
58 amoor.w a2
, a1
, 1(a0
) # CHECK: :[[@LINE]]:17: error: optional integer offset must be 0
59 amoor.w a2
, a1
, (foo
) # CHECK: :[[@LINE]]:18: error: expected register
60 amoor.w a2
, a1
, 0(foo
) # CHECK: :[[@LINE]]:19: error: expected register
61 amoor.w a2
, a1
, 0(a0
# CHECK: :[[@LINE]]:24: error: expected ')'
62 amoor.w a2
, a1
, (a0
# CHECK: :[[@LINE]]:24: error: expected ')'
64 amomin.w a2
, a1
, a0
# CHECK: :[[@LINE]]:18: error: expected '(' or optional integer offset
65 amomin.w a2
, a1
, foo
# CHECK: :[[@LINE]]:18: error: expected '(' or optional integer offset
66 amomin.w a2
, a1
, 1(a0
) # CHECK: :[[@LINE]]:18: error: optional integer offset must be 0
67 amomin.w a2
, a1
, (foo
) # CHECK: :[[@LINE]]:19: error: expected register
68 amomin.w a2
, a1
, 0(foo
) # CHECK: :[[@LINE]]:20: error: expected register
69 amomin.w a2
, a1
, 0(a0
# CHECK: :[[@LINE]]:25: error: expected ')'
70 amomin.w a2
, a1
, (a0
# CHECK: :[[@LINE]]:25: error: expected ')'
72 amomax.w a2
, a1
, a0
# CHECK: :[[@LINE]]:18: error: expected '(' or optional integer offset
73 amomax.w a2
, a1
, foo
# CHECK: :[[@LINE]]:18: error: expected '(' or optional integer offset
74 amomax.w a2
, a1
, 1(a0
) # CHECK: :[[@LINE]]:18: error: optional integer offset must be 0
75 amomax.w a2
, a1
, (foo
) # CHECK: :[[@LINE]]:19: error: expected register
76 amomax.w a2
, a1
, 0(foo
) # CHECK: :[[@LINE]]:20: error: expected register
77 amomax.w a2
, a1
, 0(a0
# CHECK: :[[@LINE]]:25: error: expected ')'
78 amomax.w a2
, a1
, (a0
# CHECK: :[[@LINE]]:25: error: expected ')'
80 amominu.w a2
, a1
, a0
# CHECK: :[[@LINE]]:19: error: expected '(' or optional integer offset
81 amominu.w a2
, a1
, foo
# CHECK: :[[@LINE]]:19: error: expected '(' or optional integer offset
82 amominu.w a2
, a1
, 1(a0
) # CHECK: :[[@LINE]]:19: error: optional integer offset must be 0
83 amominu.w a2
, a1
, (foo
) # CHECK: :[[@LINE]]:20: error: expected register
84 amominu.w a2
, a1
, 0(foo
) # CHECK: :[[@LINE]]:21: error: expected register
85 amominu.w a2
, a1
, 0(a0
# CHECK: :[[@LINE]]:26: error: expected ')'
86 amominu.w a2
, a1
, (a0
# CHECK: :[[@LINE]]:26: error: expected ')'
88 amomaxu.w a2
, a1
, a0
# CHECK: :[[@LINE]]:19: error: expected '(' or optional integer offset
89 amomaxu.w a2
, a1
, foo
# CHECK: :[[@LINE]]:19: error: expected '(' or optional integer offset
90 amomaxu.w a2
, a1
, 1(a0
) # CHECK: :[[@LINE]]:19: error: optional integer offset must be 0
91 amomaxu.w a2
, a1
, (foo
) # CHECK: :[[@LINE]]:20: error: expected register
92 amomaxu.w a2
, a1
, 0(foo
) # CHECK: :[[@LINE]]:21: error: expected register
93 amomaxu.w a2
, a1
, 0(a0
# CHECK: :[[@LINE]]:26: error: expected ')'
94 amomaxu.w a2
, a1
, (a0
# CHECK: :[[@LINE]]:26: error: expected ')'