xref: /llvm-project/llvm/test/MC/X86/align-branch-bundle.s (revision 75cdab6dc2453a508157a9c383b93373a93078d6)
1# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown --x86-align-branch-boundary=16 --x86-align-branch=fused+jcc --mc-relax-all %s | llvm-objdump --no-print-imm-hex -d --no-show-raw-insn - | FileCheck %s
2
3# Check using option --x86-align-branch-boundary=16 --x86-align-branch=fused+jcc --mc-relax-all with bundle won't make code crazy
4
5# CHECK:            0:       pushq    %rbp
6# CHECK-NEXT:       1:       testq    $2, %rdx
7# CHECK-NEXT:       8:       jne
8# CHECK-NEXT:       e:       nop
9# CHECK-NEXT:      10:       jle
10
11    .text
12    .p2align 4
13foo:
14  push %rbp
15  # Will be bundle-aligning to 8 byte boundaries
16  .bundle_align_mode 3
17  test $2, %rdx
18  jne   foo
19# This jle is 6 bytes long and should have started at 0xe, so two bytes
20# of nop padding are inserted instead and it starts at 0x10
21  jle   foo
22