1@ RUN: not llvm-mc -triple=thumbv7-apple-darwin < %s 2> %t
2@ RUN: FileCheck --check-prefix=CHECK-ERRORS < %t %s
3
4@ Ill-formed IT block instructions.
5        itet eq
6        addle r0, r1, r2
7        nop
8        it le
9        iteeee gt
10        ittfe le
11        nopeq
12
13@ CHECK-ERRORS: error: incorrect condition in IT block; got 'le', but expected 'eq'
14@ CHECK-ERRORS:         addle r0, r1, r2
15@ CHECK-ERRORS:            ^
16@ CHECK-ERRORS: error: incorrect condition in IT block; got 'al', but expected 'ne'
17@ CHECK-ERRORS:         nop
18@ CHECK-ERRORS:            ^
19@ CHECK-ERRORS: error: instructions in IT block must be predicable
20@ CHECK-ERRORS:         it le
21@ CHECK-ERRORS:         ^
22@ CHECK-ERRORS: error: too many conditions on IT instruction
23@ CHECK-ERRORS:         iteeee gt
24@ CHECK-ERRORS:           ^
25@ CHECK-ERRORS: error: illegal IT block condition mask 'tfe'
26@ CHECK-ERRORS:         ittfe le
27@ CHECK-ERRORS:           ^
28@ CHECK-ERRORS: error: predicated instructions must be in IT block
29@ CHECK-ERRORS:         nopeq
30@ CHECK-ERRORS:         ^
31
32        @ Out of range immediates for MRC/MRC2/MRRC/MRRC2
33        mrc  p14, #8, r1, c1, c2, #4
34        mrc  p14, #1, r1, c1, c2, #8
35        mrc2  p14, #8, r1, c1, c2, #4
36        mrc2  p14, #0, r1, c1, c2, #9
37        mrrc  p7, #16, r5, r4, c1
38        mrrc2  p7, #17, r5, r4, c1
39@ CHECK-ERRORS: error: invalid operand for instruction
40@ CHECK-ERRORS: error: invalid operand for instruction
41@ CHECK-ERRORS: error: invalid operand for instruction
42@ CHECK-ERRORS: error: invalid operand for instruction
43@ CHECK-ERRORS: error: immediate operand must be in the range [0,15]
44@ CHECK-ERRORS: error: immediate operand must be in the range [0,15]
45
46        isb  #-1
47        isb  #16
48@ CHECK-ERRORS: error: immediate value out of range
49@ CHECK-ERRORS: error: immediate value out of range
50
51        itt eq
52        bkpteq #1
53@ CHECK-ERRORS: error: instruction 'bkpt' is not predicable, but condition code specified
54
55        nopeq
56        nopeq
57
58@ out of range operands for Thumb2 targets
59
60        beq.w  #-1048578
61        bne.w  #1048576
62        blt.w  #1013411
63        b.w    #-16777218
64        b.w    #16777216
65        b.w    #1592313
66
67@ CHECK-ERRORS: error: branch target out of range
68@ CHECK-ERRORS: error: branch target out of range
69@ CHECK-ERRORS: error: branch target out of range
70@ CHECK-ERRORS: error: branch target out of range
71@ CHECK-ERRORS: error: branch target out of range
72@ CHECK-ERRORS: error: branch target out of range
73