Jim Grosbach | 1990672 | 2011-07-13 18:49:30 +0000 | [diff] [blame] | 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 |
Jim Grosbach | fff76ee | 2011-07-13 20:10:10 +0000 | [diff] [blame] | 43 | |
| 44 | |
| 45 | @ Out of range 16-bit immediate on BKPT |
| 46 | bkpt #65536 |
| 47 | |
| 48 | @ CHECK-ERRORS: error: invalid operand for instruction |
Jim Grosbach | 83ab070 | 2011-07-13 22:01:08 +0000 | [diff] [blame] | 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 |
Jim Grosbach | 6f9f884 | 2011-07-13 22:59:38 +0000 | [diff] [blame] | 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 |
Jim Grosbach | e540c74 | 2011-07-14 21:19:17 +0000 | [diff] [blame] | 71 | |
Jim Grosbach | c8ae39e | 2011-07-14 21:26:42 +0000 | [diff] [blame] | 72 | @ Out of range immediate for MCR/MCR2/MCRR/MCRR2 |
Jim Grosbach | e540c74 | 2011-07-14 21:19:17 +0000 | [diff] [blame] | 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 |
Jim Grosbach | c8ae39e | 2011-07-14 21:26:42 +0000 | [diff] [blame] | 77 | 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 Grosbach | e540c74 | 2011-07-14 21:19:17 +0000 | [diff] [blame] | 81 | @ 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 |