1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
llvm-mirror/test/MC/ARM/cmp-immediate-fixup2.s
Stepan Dyatkovskiy 3d2354b78a Recommitted fix for PR18931, with extended tests set.
Issue subject: Crash using integrated assembler with immediate arithmetic

Fix description:
Expressions like 'cmp r0, #(l1 - l2) >> 3' could not be evaluated on asm parsing stage,
since it is impossible to resolve labels on this stage. In the end of stage we still have
expression (MCExpr).
Then, when we want to encode it, we expect it to be an immediate, but it still an expression.
Patch introduces a Fixup (MCFixup instance), that is processed after main encoding stage.

llvm-svn: 205094
2014-03-29 13:12:40 +00:00

10 lines
202 B
ArmAsm

@ PR18931
@ RUN: llvm-mc < %s -triple=arm-linux-gnueabi -filetype=obj -o - \
@ RUN: | llvm-objdump --disassemble -arch=arm - | FileCheck %s
.text
@ CHECK: cmp r2, #0
cmp r2, #(l2 - l1)
l1:
l2: