reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced
    1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
   41
   42
   43
   44
   45
   46
   47
   48
   49
   50
   51
   52
   53
   54
   55
   56
   57
   58
   59
   60
   61
   62
   63
   64
   65
   66
   67
   68
   69
   70
   71
   72
   73
   74
   75
   76
   77
   78
   79
   80
   81
   82
   83
   84
   85
   86
   87
   88
   89
   90
   91
   92
   93
   94
# RUN: not llvm-mc %s -triple=riscv32 2>&1 | FileCheck %s
# RUN: not llvm-mc %s -triple=riscv64 2>&1 | FileCheck %s

# The below tests for lr(.w), sc(.w) and amo*(.w), using `0(reg)` are actually
# implemented using a custom parser. These tests ensure the custom parser gives
# good error messages.

lr.w a1, a0     # CHECK: :[[@LINE]]:10: error: expected '(' or optional integer offset
lr.w a1, foo    # CHECK: :[[@LINE]]:10: error: expected '(' or optional integer offset
lr.w a1, 1(a0)  # CHECK: :[[@LINE]]:10: error: optional integer offset must be 0
lr.w a1, (foo)  # CHECK: :[[@LINE]]:11: error: expected register
lr.w a1, 0(foo) # CHECK: :[[@LINE]]:12: error: expected register
lr.w a1, 0(a0   # CHECK: :[[@LINE]]:17: error: expected ')'
lr.w a1, (a0    # CHECK: :[[@LINE]]:17: error: expected ')'

sc.w a2, a1, a0     # CHECK: :[[@LINE]]:14: error: expected '(' or optional integer offset
sc.w a2, a1, foo    # CHECK: :[[@LINE]]:14: error: expected '(' or optional integer offset
sc.w a2, a1, 1(a0)  # CHECK: :[[@LINE]]:14: error: optional integer offset must be 0
sc.w a2, a1, (foo)  # CHECK: :[[@LINE]]:15: error: expected register
sc.w a2, a1, 0(foo) # CHECK: :[[@LINE]]:16: error: expected register
sc.w a2, a1, 0(a0   # CHECK: :[[@LINE]]:21: error: expected ')'
sc.w a2, a1, (a0    # CHECK: :[[@LINE]]:21: error: expected ')'

amoswap.w a2, a1, a0     # CHECK: :[[@LINE]]:19: error: expected '(' or optional integer offset
amoswap.w a2, a1, foo    # CHECK: :[[@LINE]]:19: error: expected '(' or optional integer offset
amoswap.w a2, a1, 1(a0)  # CHECK: :[[@LINE]]:19: error: optional integer offset must be 0
amoswap.w a2, a1, (foo)  # CHECK: :[[@LINE]]:20: error: expected register
amoswap.w a2, a1, 0(foo) # CHECK: :[[@LINE]]:21: error: expected register
amoswap.w a2, a1, 0(a0   # CHECK: :[[@LINE]]:26: error: expected ')'
amoswap.w a2, a1, (a0    # CHECK: :[[@LINE]]:26: error: expected ')'

amoadd.w a2, a1, a0     # CHECK: :[[@LINE]]:18: error: expected '(' or optional integer offset
amoadd.w a2, a1, foo    # CHECK: :[[@LINE]]:18: error: expected '(' or optional integer offset
amoadd.w a2, a1, 1(a0)  # CHECK: :[[@LINE]]:18: error: optional integer offset must be 0
amoadd.w a2, a1, (foo)  # CHECK: :[[@LINE]]:19: error: expected register
amoadd.w a2, a1, 0(foo) # CHECK: :[[@LINE]]:20: error: expected register
amoadd.w a2, a1, 0(a0   # CHECK: :[[@LINE]]:25: error: expected ')'
amoadd.w a2, a1, (a0    # CHECK: :[[@LINE]]:25: error: expected ')'

amoxor.w a2, a1, a0     # CHECK: :[[@LINE]]:18: error: expected '(' or optional integer offset
amoxor.w a2, a1, foo    # CHECK: :[[@LINE]]:18: error: expected '(' or optional integer offset
amoxor.w a2, a1, 1(a0)  # CHECK: :[[@LINE]]:18: error: optional integer offset must be 0
amoxor.w a2, a1, (foo)  # CHECK: :[[@LINE]]:19: error: expected register
amoxor.w a2, a1, 0(foo) # CHECK: :[[@LINE]]:20: error: expected register
amoxor.w a2, a1, 0(a0   # CHECK: :[[@LINE]]:25: error: expected ')'
amoxor.w a2, a1, (a0    # CHECK: :[[@LINE]]:25: error: expected ')'

amoand.w a2, a1, a0     # CHECK: :[[@LINE]]:18: error: expected '(' or optional integer offset
amoand.w a2, a1, foo    # CHECK: :[[@LINE]]:18: error: expected '(' or optional integer offset
amoand.w a2, a1, 1(a0)  # CHECK: :[[@LINE]]:18: error: optional integer offset must be 0
amoand.w a2, a1, (foo)  # CHECK: :[[@LINE]]:19: error: expected register
amoand.w a2, a1, 0(foo) # CHECK: :[[@LINE]]:20: error: expected register
amoand.w a2, a1, 0(a0   # CHECK: :[[@LINE]]:25: error: expected ')'
amoand.w a2, a1, (a0    # CHECK: :[[@LINE]]:25: error: expected ')'

amoor.w a2, a1, a0     # CHECK: :[[@LINE]]:17: error: expected '(' or optional integer offset
amoor.w a2, a1, foo    # CHECK: :[[@LINE]]:17: error: expected '(' or optional integer offset
amoor.w a2, a1, 1(a0)  # CHECK: :[[@LINE]]:17: error: optional integer offset must be 0
amoor.w a2, a1, (foo)  # CHECK: :[[@LINE]]:18: error: expected register
amoor.w a2, a1, 0(foo) # CHECK: :[[@LINE]]:19: error: expected register
amoor.w a2, a1, 0(a0   # CHECK: :[[@LINE]]:24: error: expected ')'
amoor.w a2, a1, (a0    # CHECK: :[[@LINE]]:24: error: expected ')'

amomin.w a2, a1, a0     # CHECK: :[[@LINE]]:18: error: expected '(' or optional integer offset
amomin.w a2, a1, foo    # CHECK: :[[@LINE]]:18: error: expected '(' or optional integer offset
amomin.w a2, a1, 1(a0)  # CHECK: :[[@LINE]]:18: error: optional integer offset must be 0
amomin.w a2, a1, (foo)  # CHECK: :[[@LINE]]:19: error: expected register
amomin.w a2, a1, 0(foo) # CHECK: :[[@LINE]]:20: error: expected register
amomin.w a2, a1, 0(a0   # CHECK: :[[@LINE]]:25: error: expected ')'
amomin.w a2, a1, (a0    # CHECK: :[[@LINE]]:25: error: expected ')'

amomax.w a2, a1, a0     # CHECK: :[[@LINE]]:18: error: expected '(' or optional integer offset
amomax.w a2, a1, foo    # CHECK: :[[@LINE]]:18: error: expected '(' or optional integer offset
amomax.w a2, a1, 1(a0)  # CHECK: :[[@LINE]]:18: error: optional integer offset must be 0
amomax.w a2, a1, (foo)  # CHECK: :[[@LINE]]:19: error: expected register
amomax.w a2, a1, 0(foo) # CHECK: :[[@LINE]]:20: error: expected register
amomax.w a2, a1, 0(a0   # CHECK: :[[@LINE]]:25: error: expected ')'
amomax.w a2, a1, (a0    # CHECK: :[[@LINE]]:25: error: expected ')'

amominu.w a2, a1, a0     # CHECK: :[[@LINE]]:19: error: expected '(' or optional integer offset
amominu.w a2, a1, foo    # CHECK: :[[@LINE]]:19: error: expected '(' or optional integer offset
amominu.w a2, a1, 1(a0)  # CHECK: :[[@LINE]]:19: error: optional integer offset must be 0
amominu.w a2, a1, (foo)  # CHECK: :[[@LINE]]:20: error: expected register
amominu.w a2, a1, 0(foo) # CHECK: :[[@LINE]]:21: error: expected register
amominu.w a2, a1, 0(a0   # CHECK: :[[@LINE]]:26: error: expected ')'
amominu.w a2, a1, (a0    # CHECK: :[[@LINE]]:26: error: expected ')'

amomaxu.w a2, a1, a0     # CHECK: :[[@LINE]]:19: error: expected '(' or optional integer offset
amomaxu.w a2, a1, foo    # CHECK: :[[@LINE]]:19: error: expected '(' or optional integer offset
amomaxu.w a2, a1, 1(a0)  # CHECK: :[[@LINE]]:19: error: optional integer offset must be 0
amomaxu.w a2, a1, (foo)  # CHECK: :[[@LINE]]:20: error: expected register
amomaxu.w a2, a1, 0(foo) # CHECK: :[[@LINE]]:21: error: expected register
amomaxu.w a2, a1, 0(a0   # CHECK: :[[@LINE]]:26: error: expected ')'
amomaxu.w a2, a1, (a0    # CHECK: :[[@LINE]]:26: error: expected ')'