1@ RUN: llvm-mc -triple=armv7-apple-darwin -show-encoding < %s | FileCheck %s
2
3@------------------------------------------------------------------------------
4@ Branch targets destined for ARM mode must == 0 (mod 4), otherwise (mod 2).
5@------------------------------------------------------------------------------
6
7        b #4
8        bl #4
9        beq #4
10        blx #2
11
12@ CHECK: b	#4                      @ encoding: [0x01,0x00,0x00,0xea]
13@ CHECK: bl	#4                      @ encoding: [0x01,0x00,0x00,0xeb]
14@ CHECK: beq	#4                      @ encoding: [0x01,0x00,0x00,0x0a]
15@ CHECK: blx	#2                      @ encoding: [0x00,0x00,0x00,0xfb]
16
17@------------------------------------------------------------------------------
18@ Leading '$' on branch targets must not be dropped if part of symbol names
19@------------------------------------------------------------------------------
20
21        .global $foo
22        .global $4
23        b $foo
24        bl $foo
25        beq $foo
26        blx $foo
27        b $foo + 4
28        bl $4
29        beq $4 + 4
30
31@ CHECK: b      ($foo)                      @ encoding: [A,A,A,0xea]
32@ CHECK: bl     ($foo)                      @ encoding: [A,A,A,0xeb]
33@ CHECK: beq    ($foo)                      @ encoding: [A,A,A,0x0a]
34@ CHECK: blx    ($foo)                      @ encoding: [A,A,A,0xfa]
35@ CHECK: b      #($foo)+4                   @ encoding: [A,A,A,0xea]
36@ CHECK: bl     ($4)                        @ encoding: [A,A,A,0xeb]
37@ CHECK: beq    #($4)+4                     @ encoding: [A,A,A,0x0a]
38
39@------------------------------------------------------------------------------
40@ Leading '$' should be allowed to introduce an expression
41@------------------------------------------------------------------------------
42
43        .global bar
44        b $ 4
45        bl $ bar + 4
46        blx $ bar
47@ CHECK: b	    #4                        @ encoding: [0x01,0x00,0x00,0xea]
48@ CHECK: bl     #bar+4                    @ encoding: [A,A,A,0xeb]
49@ CHECK: blx    bar                       @ encoding: [A,A,A,0xfa]
50