Thumb ADD(immediate) parsing support.
[oota-llvm.git] / test / MC / ARM / basic-thumb-instructions.s
1 @ RUN: llvm-mc -triple=thumbv6-apple-darwin -show-encoding < %s | FileCheck %s
2   .syntax unified
3   .globl _func
4
5 @ Check that the assembler can handle the documented syntax from the ARM ARM.
6 @ For complex constructs like shifter operands, check more thoroughly for them
7 @ once then spot check that following instructions accept the form generally.
8 @ This gives us good coverage while keeping the overall size of the test
9 @ more reasonable.
10
11 _func:
12 @ CHECK: _func
13
14 @------------------------------------------------------------------------------
15 @ ADD (immediate)
16 @------------------------------------------------------------------------------
17         adds r1, r2, #3
18         adds r2, #3
19         adds r2, #8
20
21 @ CHECK: adds   r1, r2, #3              @ encoding: [0xd1,0x1c]
22 @ CHECK: adds   r2, r2, #3              @ encoding: [0xd2,0x1c]
23 @ CHECK: adds   r2, #8                  @ encoding: [0x08,0x32]
24
25
26 @------------------------------------------------------------------------------
27 @ ADD (register)
28 @------------------------------------------------------------------------------
29         adds r1, r2, r3
30         add r2, r8
31
32 @ CHECK: adds   r1, r2, r3              @ encoding: [0xd1,0x18]
33   CHECK: add    r2, r8                  @ encoding: [0x42,0x44]