PR18931, PATCH: Crash using integrated assembler with immediate arithmetic

Stepan Dyatkovskiy stpworld at
Tue Mar 25 09:31:34 PDT 2014

Hi all!
Please find patch in attachment for review.

Expression in test-case 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 immediate, but it 
still expression.
Patch introduces a Fixup (MCFixup instance), that is processed after 
main encoding stage.
Patch also contains test-case.

-------------- next part --------------
// PR18931
// RUN: llvm-mc < %s -triple=arm-linux-gnueabi -filetype=obj -o - \
// RUN: | llvm-objdump --disassemble -arch=arm - | FileCheck %s

// CHECK: #1
    cmp r2, #(l2 - l1 + 4) >> 2

More information about the llvm-commits mailing list