ARM MCR/MCR2 assembly parsing operand constraints.
[oota-llvm.git] / test / MC / ARM / diagnostics.s
1 @ RUN: not llvm-mc -triple=armv7-apple-darwin < %s 2> %t
2 @ RUN: FileCheck --check-prefix=CHECK-ERRORS < %t %s
3
4 @ Check for various assembly diagnostic messages on invalid input.
5
6         @ Out of range shift immediate values.
7         adc r1, r2, r3, lsl #invalid
8         adc r4, r5, r6, lsl #-1
9         adc r4, r5, r6, lsl #32
10         adc r4, r5, r6, lsr #-1
11         adc r4, r5, r6, lsr #33
12         adc r4, r5, r6, asr #-1
13         adc r4, r5, r6, asr #33
14         adc r4, r5, r6, ror #-1
15         adc r4, r5, r6, ror #32
16
17 @ CHECK-ERRORS: error: invalid immediate shift value
18 @ CHECK-ERRORS:         adc r1, r2, r3, lsl #invalid
19 @ CHECK-ERRORS:                              ^
20 @ CHECK-ERRORS: error: immediate shift value out of range
21 @ CHECK-ERRORS:         adc r4, r5, r6, lsl #-1
22 @ CHECK-ERRORS:                              ^
23 @ CHECK-ERRORS: error: immediate shift value out of range
24 @ CHECK-ERRORS:         adc r4, r5, r6, lsl #32
25 @ CHECK-ERRORS:                              ^
26 @ CHECK-ERRORS: error: immediate shift value out of range
27 @ CHECK-ERRORS:         adc r4, r5, r6, lsr #-1
28 @ CHECK-ERRORS:                              ^
29 @ CHECK-ERRORS: error: immediate shift value out of range
30 @ CHECK-ERRORS:         adc r4, r5, r6, lsr #33
31 @ CHECK-ERRORS:                              ^
32 @ CHECK-ERRORS: error: immediate shift value out of range
33 @ CHECK-ERRORS:         adc r4, r5, r6, asr #-1
34 @ CHECK-ERRORS:                              ^
35 @ CHECK-ERRORS: error: immediate shift value out of range
36 @ CHECK-ERRORS:         adc r4, r5, r6, asr #33
37 @ CHECK-ERRORS:                              ^
38 @ CHECK-ERRORS: error: immediate shift value out of range
39 @ CHECK-ERRORS:         adc r4, r5, r6, ror #-1
40 @ CHECK-ERRORS:                              ^
41 @ CHECK-ERRORS: error: immediate shift value out of range
42 @ CHECK-ERRORS:         adc r4, r5, r6, ror #32
43
44
45         @ Out of range 16-bit immediate on BKPT
46         bkpt #65536
47
48 @ CHECK-ERRORS: error: invalid operand for instruction
49
50         @ Out of range 4 and 3 bit immediates on CDP[2]
51
52         @ Out of range immediates for CDP/CDP2
53         cdp  p7, #2, c1, c1, c1, #8
54         cdp  p7, #1, c1, c1, c1, #8
55         cdp2  p7, #2, c1, c1, c1, #8
56         cdp2  p7, #1, c1, c1, c1, #8
57
58 @ CHECK-ERRORS: error: invalid operand for instruction
59 @ CHECK-ERRORS: error: invalid operand for instruction
60 @ CHECK-ERRORS: error: invalid operand for instruction
61 @ CHECK-ERRORS: error: invalid operand for instruction
62
63         @ Out of range immediates for DBG
64         dbg #-1
65         dbg #16
66
67 @ CHECK-ERRORS: error: invalid operand for instruction
68 @ CHECK-ERRORS: error: invalid operand for instruction
69 @  Double-check that we're synced up with the right diagnostics.
70 @ CHECK-ERRORS: dbg #16
71
72         @ Out of range immediate for MCR/MCR2
73         mcr  p7, #8, r5, c1, c1, #4
74         mcr  p7, #2, r5, c1, c1, #8
75         mcr2  p7, #8, r5, c1, c1, #4
76         mcr2  p7, #1, r5, c1, c1, #8
77 @ CHECK-ERRORS: error: invalid operand for instruction
78 @ CHECK-ERRORS: error: invalid operand for instruction
79 @ CHECK-ERRORS: error: invalid operand for instruction
80 @ CHECK-ERRORS: error: invalid operand for instruction