50 lines · plain
1@ RUN: llvm-mc -triple=armv7-apple-darwin -show-encoding < %s | FileCheck %s2 3@------------------------------------------------------------------------------4@ Branch targets destined for ARM mode must == 0 (mod 4), otherwise (mod 2).5@------------------------------------------------------------------------------6 7 b #48 bl #49 beq #410 blx #211 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 names19@------------------------------------------------------------------------------20 21 .global $foo22 .global $423 b $foo24 bl $foo25 beq $foo26 blx $foo27 b $foo + 428 bl $429 beq $4 + 430 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 expression41@------------------------------------------------------------------------------42 43 .global bar44 b $ 445 bl $ bar + 446 blx $ bar47@ 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