llvm-mirror/test/MC/ARM/AlignedBundling/subtarget-change.s
Peter Smith 7d816e3012 [MC] Pass MCSubtargetInfo to fixupNeedsRelaxation and applyFixup
On targets like Arm some relaxations may only be performed when certain
architectural features are available. As functions can be compiled with
differing levels of architectural support we must make a judgement on
whether we can relax based on the MCSubtargetInfo for the function. This
change passes through the MCSubtargetInfo for the function to
fixupNeedsRelaxation so that the decision on whether to relax can be made
per function. In this patch, only the ARM backend makes use of this
information. We must also pass the MCSubtargetInfo to applyFixup because
some fixups skip error checking on the assumption that relaxation has
occurred, to prevent code-generation errors applyFixup must see the same
MCSubtargetInfo as fixupNeedsRelaxation.

Differential Revision: https://reviews.llvm.org/D44928

llvm-svn: 334078
2018-06-06 09:40:06 +00:00

34 lines
910 B
ArmAsm

# RUN: llvm-mc -filetype=obj -triple armv7-linux-gnueabi %s -o - \
# RUN: | llvm-objdump -no-show-raw-insn -triple armv7 -disassemble - | FileCheck %s
# We can switch subtargets with .arch outside of a bundle
.syntax unified
.text
.bundle_align_mode 4
.arch armv4t
bx lr
.bundle_lock
and r1, r1, r1
and r1, r1, r1
.bundle_unlock
bx lr
# We can switch subtargets at the start of a bundle
bx lr
.bundle_lock align_to_end
.arch armv7a
movt r0, #0xffff
movw r0, #0xffff
.bundle_unlock
bx lr
# CHECK: 0: bx lr
# CHECK-NEXT: 4: and r1, r1, r1
# CHECK-NEXT: 8: and r1, r1, r1
# CHECK-NEXT: c: bx lr
# CHECK-NEXT: 10: bx lr
# CHECK-NEXT: 14: nop
# CHECK-NEXT: 18: movt r0, #65535
# CHECK-NEXT: 1c: movw r0, #65535
# CHECK-NEXT: 20: bx lr