blob: 7a9d85e9449272ca57c4c59138748f9058f7b024 [file] [log] [blame]
Jim Grosbach19906722011-07-13 18:49:30 +00001@ 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
Jim Grosbachfff76ee2011-07-13 20:10:10 +000043
44
45 @ Out of range 16-bit immediate on BKPT
46 bkpt #65536
47
48@ CHECK-ERRORS: error: invalid operand for instruction
Jim Grosbach83ab0702011-07-13 22:01:08 +000049
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
Jim Grosbach6f9f8842011-07-13 22:59:38 +000062
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
Jim Grosbache540c742011-07-14 21:19:17 +000071
Jim Grosbachc8ae39e2011-07-14 21:26:42 +000072 @ Out of range immediate for MCR/MCR2/MCRR/MCRR2
Jim Grosbache540c742011-07-14 21:19:17 +000073 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
Jim Grosbachc8ae39e2011-07-14 21:26:42 +000077 mcrr p7, #16, r5, r4, c1
78 mcrr2 p7, #16, r5, r4, c1
79@ CHECK-ERRORS: error: invalid operand for instruction
80@ CHECK-ERRORS: error: invalid operand for instruction
Jim Grosbache540c742011-07-14 21:19:17 +000081@ CHECK-ERRORS: error: invalid operand for instruction
82@ CHECK-ERRORS: error: invalid operand for instruction
83@ CHECK-ERRORS: error: invalid operand for instruction
84@ CHECK-ERRORS: error: invalid operand for instruction