[NFC][RemoveDIs] Prefer iterators over inst-pointers in InstCombine
[llvm-project.git] / llvm / test / MC / Xtensa / Core / invalid.s
blobd3d8fba8169a6d2206621184398ea0accd97f358
1 # RUN: not llvm-mc -triple xtensa %s 2>&1 | FileCheck %s
3 LBL0:
5 # Out of range immediates
7 # imm12m
8 movi a1, 3000
9 # CHECK: :[[#@LINE-1]]:10: error: expected immediate in range [-2048, 2047]
11 # imm8
12 addi a1, a2, 300
13 # CHECK: :[[#@LINE-1]]:14: error: expected immediate in range [-128, 127]
15 # imm8
16 addi a1, a2, -129
17 # CHECK: :[[#@LINE-1]]:14: error: expected immediate in range [-128, 127]
19 # imm8_sh8
20 addmi a1, a2, 33
21 # CHECK: :[[#@LINE-1]]:15: error: expected immediate in range [-32768, 32512], first 8 bits should be zero
23 # shimm1_31
24 slli a1, a2, 0
25 # CHECK: :[[#@LINE-1]]:14: error: expected immediate in range [1, 31]
27 # uimm4
28 srli a1, a2, 16
29 # CHECK: :[[#@LINE-1]]:14: error: expected immediate in range [0, 15]
31 # uimm5
32 srai a2, a3, 32
33 # CHECK: :[[#@LINE-1]]:14: error: expected immediate in range [0, 31]
35 # imm1_16
36 extui a1, a3, 1, 17
37 # CHECK: :[[#@LINE-1]]:18: error: expected immediate in range [1, 16]
39 # offset8m8
40 s8i a1, a2, 300
41 # CHECK: :[[#@LINE-1]]:13: error: expected immediate in range [0, 255]
43 # offset16m8
44 l16si a1, a2, 512
45 # CHECK: :[[#@LINE-1]]:15: error: expected immediate in range [0, 510], first bit should be zero
47 # offset32m8
48 l32i a1, a2, 1024
49 # CHECK: :[[#@LINE-1]]:14: error: expected immediate in range [0, 1020], first 2 bits should be zero
51 # b4const
52 beqi a1, 257, LBL0
53 # CHECK: :[[#@LINE-1]]:10: error: expected b4const immediate
55 # b4constu
56 bgeui a9, 32000, LBL0
57 # CHECK: :[[#@LINE-1]]:11: error: expected b4constu immediate
59 # Invalid number of operands
60 addi a1, a2
61 # CHECK: :[[#@LINE-1]]:1: error: too few operands for instruction
62 addi a1, a2, 4, 4
63 # CHECK: :[[#@LINE-1]]:17: error: invalid operand for instruction
65 # Invalid mnemonics
66 aaa a10, a12
67 # CHECK: :[[#@LINE-1]]:1: error: unrecognized instruction mnemonic
69 # Invalid operand types
70 and sp, a2, 10
71 # CHECK: :[[#@LINE-1]]:13: error: invalid operand for instruction
72 addi sp, a1, a2
73 # CHECK: :[[#@LINE-1]]:14: error: expected immediate in range [-128, 127]
75 # Check invalid register names for different formats
76 # Instruction format RRR
77 or r2, sp, a3
78 # CHECK: :[[#@LINE-1]]:4: error: invalid operand for instruction
79 and a1, r10, a3
80 # CHECK: :[[#@LINE-1]]:9: error: invalid operand for instruction
81 sub a1, sp, a100
82 # CHECK: :[[#@LINE-1]]:13: error: invalid operand for instruction
84 # Instruction format RRI8
85 addi a101, sp, 10
86 # CHECK: :[[#@LINE-1]]:6: error: invalid operand for instruction
87 addi a1, r10, 10
88 # CHECK: :[[#@LINE-1]]:10: error: invalid operand for instruction
90 # Instruction format RSR
91 wsr.uregister a2
92 # CHECK: :[[#@LINE-1]]:1: error: invalid register name
93 wsr a2, uregister
94 # CHECK: :[[#@LINE-1]]:9: error: invalid operand for instruction
96 # Instruction format BRI12
97 beqz b1, LBL0
98 # CHECK: :[[#@LINE-1]]:6: error: invalid operand for instruction
99 # Instruction format BRI8
100 bltui r7, 16, LBL0
101 # CHECK: :[[#@LINE-1]]:7: error: invalid operand for instruction
103 # Instruction format CALLX
104 callx0 r10
105 # CHECK: :[[#@LINE-1]]:8: error: invalid operand for instruction
107 # Check invalid operands order for different formats
108 # Instruction format RRI8
109 addi a1, 10, a2
110 # CHECK: :[[#@LINE-1]]:10: error: invalid operand for instruction
112 # Instruction format RSR
113 wsr sar, a2
114 # CHECK: :[[#@LINE-1]]:5: error: invalid operand for instruction
116 # Instruction format BRI12
117 beqz LBL0, a2
118 # CHECK: :[[#@LINE-1]]:6: error: invalid operand for instruction
120 # Instruction format BRI8
121 bltui 16, a7, LBL0
122 # CHECK: :[[#@LINE-1]]:7: error: invalid operand for instruction
123 bltui a7, LBL0, 16
124 # CHECK: :[[#@LINE-1]]:19: error: unknown operand