diff options
author | Jim Grosbach <grosbach@apple.com> | 2012-04-27 23:51:36 +0000 |
---|---|---|
committer | Jim Grosbach <grosbach@apple.com> | 2012-04-27 23:51:36 +0000 |
commit | a9cc08f24f61e2663a131d7ac16c329b75162e7b (patch) | |
tree | dc2b18dcff471f7b42d87e2fd3d06cac2bd4a38b /test/MC | |
parent | bb32f1d545241ab957f402165cec359d4473c0ca (diff) | |
download | llvm-a9cc08f24f61e2663a131d7ac16c329b75162e7b.tar.gz llvm-a9cc08f24f61e2663a131d7ac16c329b75162e7b.tar.bz2 llvm-a9cc08f24f61e2663a131d7ac16c329b75162e7b.tar.xz |
ARM: Thumb add(sp plus register) asm constraints.
Make sure when parsing the Thumb1 sp+register ADD instruction that
the source and destination operands match. In thumb2, just use the
wide encoding if they don't. In Thumb1, issue a diagnostic.
rdar://11219154
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155748 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/MC')
-rw-r--r-- | test/MC/ARM/basic-thumb2-instructions.s | 2 | ||||
-rw-r--r-- | test/MC/ARM/thumb-diagnostics.s | 5 |
2 files changed, 7 insertions, 0 deletions
diff --git a/test/MC/ARM/basic-thumb2-instructions.s b/test/MC/ARM/basic-thumb2-instructions.s index 4aed9e2bea..a0dc3dd3a1 100644 --- a/test/MC/ARM/basic-thumb2-instructions.s +++ b/test/MC/ARM/basic-thumb2-instructions.s @@ -48,6 +48,7 @@ _func: adcs r0, r1, r3, lsl #7 adc.w r0, r1, r3, lsr #31 adcs.w r0, r1, r3, asr #32 + add r2, sp, ip @ CHECK: adc.w r4, r5, r6 @ encoding: [0x45,0xeb,0x06,0x04] @ CHECK: adcs.w r4, r5, r6 @ encoding: [0x55,0xeb,0x06,0x04] @@ -57,6 +58,7 @@ _func: @ CHECK: adcs.w r0, r1, r3, lsl #7 @ encoding: [0x51,0xeb,0xc3,0x10] @ CHECK: adc.w r0, r1, r3, lsr #31 @ encoding: [0x41,0xeb,0xd3,0x70] @ CHECK: adcs.w r0, r1, r3, asr #32 @ encoding: [0x51,0xeb,0x23,0x00] +@ CHECK: add.w r2, sp, r12 @ encoding: [0x0d,0xeb,0x0c,0x02] @------------------------------------------------------------------------------ diff --git a/test/MC/ARM/thumb-diagnostics.s b/test/MC/ARM/thumb-diagnostics.s index 4d09af32ef..0902f4e6fb 100644 --- a/test/MC/ARM/thumb-diagnostics.s +++ b/test/MC/ARM/thumb-diagnostics.s @@ -133,3 +133,8 @@ error: invalid operand for instruction @ CHECK-ERRORS: error: instruction requires: arm-mode @ CHECK-ERRORS: add r2, sp, #1024 @ CHECK-ERRORS: ^ + + add r2, sp, ip +@ CHECK-ERRORS: error: source register must be the same as destination +@ CHECK-ERRORS: add r2, sp, ip +@ CHECK-ERRORS: ^ |