summaryrefslogtreecommitdiff
path: root/test/MC/X86
diff options
context:
space:
mode:
authorDerek Schuff <dschuff@google.com>2013-02-05 17:55:27 +0000
committerDerek Schuff <dschuff@google.com>2013-02-05 17:55:27 +0000
commitf918d7fd7393049bc87bc03fda2d2cd3cec1dacb (patch)
tree1a4d4eb30a7e87383e67c3e47147fec66c04044c /test/MC/X86
parenta499d2bcef0c1001c60d752d356e50eed2402ca8 (diff)
downloadllvm-f918d7fd7393049bc87bc03fda2d2cd3cec1dacb.tar.gz
llvm-f918d7fd7393049bc87bc03fda2d2cd3cec1dacb.tar.bz2
llvm-f918d7fd7393049bc87bc03fda2d2cd3cec1dacb.tar.xz
[MC] Bundle alignment: Invalidate relaxed fragments
Currently, when a fragment is relaxed, its size is modified, but its offset is not (it gets laid out as a side effect of checking whether it needs relaxation), then all subsequent fragments are invalidated because their offsets need to change. When bundling is enabled, relaxed fragments need to get laid out again, because the increase in size may push it over a bundle boundary. So instead of only invalidating subsequent fragments, also invalidate the fragment that gets relaxed, which causes it to get laid out again. This patch also fixes some trailing whitespace and fixes the bundling-related debug output of MCFragments. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174401 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/MC/X86')
-rw-r--r--test/MC/X86/AlignedBundling/relax-at-bundle-end.s16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/MC/X86/AlignedBundling/relax-at-bundle-end.s b/test/MC/X86/AlignedBundling/relax-at-bundle-end.s
new file mode 100644
index 0000000000..ab4affbbea
--- /dev/null
+++ b/test/MC/X86/AlignedBundling/relax-at-bundle-end.s
@@ -0,0 +1,16 @@
+# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - \
+# RUN: | llvm-objdump -disassemble -no-show-raw-insn - | FileCheck %s
+
+# Test that an instruction near a bundle end gets properly padded
+# after it is relaxed.
+.text
+foo:
+ .bundle_align_mode 5
+ .rept 29
+ push %rax
+ .endr
+# CHECK: 1c: push
+# CHECK: 1d: nop
+# CHECK: 20: jne
+ jne 0x100
+