thumb-diagnostics.s revision 93b3eff62322803a520e183fdc294bffd6d99bfa
1@ RUN: not llvm-mc -triple=thumbv6-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@ ADD instruction w/o 'S' suffix.
7        add r1, r2, r3
8@ CHECK-ERRORS: error: invalid instruction
9@ CHECK-ERRORS:         add r1, r2, r3
10@ CHECK-ERRORS:         ^
11
12@ Instructions which require v6+ for both registers to be low regs.
13        add r2, r3
14        mov r2, r3
15@ CHECK-ERRORS: error: instruction variant requires Thumb2
16@ CHECK-ERRORS:         add r2, r3
17@ CHECK-ERRORS:         ^
18@ CHECK-ERRORS: error: instruction variant requires ARMv6 or later
19@ CHECK-ERRORS:         mov r2, r3
20@ CHECK-ERRORS:         ^
21
22
23@ Out of range immediates for ASR instruction.
24        asrs r2, r3, #33
25        asrs r2, r3, #0
26@ CHECK-ERRORS: error: invalid operand for instruction
27@ CHECK-ERRORS:         asrs r2, r3, #33
28@ CHECK-ERRORS:                      ^
29@ CHECK-ERRORS: error: invalid operand for instruction
30@ CHECK-ERRORS:         asrs r2, r3, #0
31@ CHECK-ERRORS:                      ^
32
33@ Out of range immediates for BKPT instruction.
34        bkpt #256
35        bkpt #-1
36error: invalid operand for instruction
37        bkpt #256
38             ^
39error: invalid operand for instruction
40        bkpt #-1
41             ^
42
43@ Invalid writeback and register lists for LDM
44        ldm r2!, {r5, r8}
45        ldm r2, {r5, r7}
46@ CHECK-ERRORS: error: registers must be in range r0-r7
47@ CHECK-ERRORS:         ldm r2!, {r5, r8}
48@ CHECK-ERRORS:                  ^
49@ CHECK-ERRORS: error: writeback operator '!' expected
50@ CHECK-ERRORS:         ldm r2, {r5, r7}
51@ CHECK-ERRORS:             ^
52