Thumb assembly parsing and encoding for MUL.
[oota-llvm.git] / test / MC / ARM / thumb-diagnostics.s
1 @ RUN: not llvm-mc -triple=thumbv6-apple-darwin < %s 2> %t
2 @ RUN: FileCheck --check-prefix=CHECK-ERRORS < %t %s
3 @ RUN: not llvm-mc -triple=thumbv5-apple-darwin < %s 2> %t
4 @ RUN: FileCheck --check-prefix=CHECK-ERRORS-V5 < %t %s
5
6 @ Check for various assembly diagnostic messages on invalid input.
7
8 @ ADD instruction w/o 'S' suffix.
9         add r1, r2, r3
10 @ CHECK-ERRORS: error: invalid instruction
11 @ CHECK-ERRORS:         add r1, r2, r3
12 @ CHECK-ERRORS:         ^
13
14 @ Instructions which require v6+ for both registers to be low regs.
15         add r2, r3
16         mov r2, r3
17 @ CHECK-ERRORS: error: instruction variant requires Thumb2
18 @ CHECK-ERRORS:         add r2, r3
19 @ CHECK-ERRORS:         ^
20 @ CHECK-ERRORS-V5: error: instruction variant requires ARMv6 or later
21 @ CHECK-ERRORS-V5:         mov r2, r3
22 @ CHECK-ERRORS-V5:         ^
23
24
25 @ Out of range immediates for ASR instruction.
26         asrs r2, r3, #33
27         asrs r2, r3, #0
28 @ CHECK-ERRORS: error: invalid operand for instruction
29 @ CHECK-ERRORS:         asrs r2, r3, #33
30 @ CHECK-ERRORS:                      ^
31 @ CHECK-ERRORS: error: invalid operand for instruction
32 @ CHECK-ERRORS:         asrs r2, r3, #0
33 @ CHECK-ERRORS:                      ^
34
35 @ Out of range immediates for BKPT instruction.
36         bkpt #256
37         bkpt #-1
38 error: invalid operand for instruction
39         bkpt #256
40              ^
41 error: invalid operand for instruction
42         bkpt #-1
43              ^
44
45 @ Invalid writeback and register lists for LDM
46         ldm r2!, {r5, r8}
47         ldm r2, {r5, r7}
48 @ CHECK-ERRORS: error: registers must be in range r0-r7
49 @ CHECK-ERRORS:         ldm r2!, {r5, r8}
50 @ CHECK-ERRORS:                  ^
51 @ CHECK-ERRORS: error: writeback operator '!' expected
52 @ CHECK-ERRORS:         ldm r2, {r5, r7}
53 @ CHECK-ERRORS:             ^
54
55
56 @ Out of range immediates for LSL instruction.
57         lsls r4, r5, #-1
58         lsls r4, r5, #32
59 @ CHECK-ERRORS: error: invalid operand for instruction
60 @ CHECK-ERRORS:         lsls r4, r5, #-1
61 @ CHECK-ERRORS:                      ^
62 @ CHECK-ERRORS: error: invalid operand for instruction
63 @ CHECK-ERRORS:         lsls r4, r5, #32
64 @ CHECK-ERRORS:                      ^
65
66 @ Mismatched source/destination operands for MUL instruction.
67         muls r1, r2, r3
68 @ CHECK-ERRORS: error: destination register must match second source register
69 @ CHECK-ERRORS:         muls r1, r2, r3
70 @ CHECK-ERRORS:              ^