1# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - \
2# RUN:   | llvm-objdump -disassemble -no-show-raw-insn - | FileCheck %s
3# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu -mc-relax-all %s -o - \
4# RUN:   | llvm-objdump -disassemble -no-show-raw-insn - | FileCheck %s
5
6# Test some variations of padding to the end of a bundle.
7
8  .text
9foo:
10  .bundle_align_mode 4
11
12# Each of these callq instructions is 5 bytes long
13  callq   bar
14  callq   bar
15  .bundle_lock align_to_end
16  callq   bar
17  .bundle_unlock
18# To align this group to a bundle end, we need a 1-byte NOP.
19# CHECK:        a:  nop
20# CHECK-NEXT:   b: callq
21
22  callq   bar
23  callq   bar
24  .bundle_lock align_to_end
25  callq   bar
26  callq   bar
27  .bundle_unlock
28# Here we have to pad until the end of the *next* boundary because
29# otherwise the group crosses a boundary.
30# CHECK:      1a: nop
31# The nop sequence may be implemented as one instruction or many, but if
32# it's one instruction, that instruction cannot itself cross the boundary.
33# CHECK:      20: nop
34# CHECK-NEXT: 26: callq
35# CHECK-NEXT: 2b: callq
36