Home | History | Annotate | Download | only in AlignedBundling
      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 
      4 # Test simple NOP insertion for single instructions.
      5 
      6   .text
      7 foo:
      8   # Will be bundle-aligning to 16 byte boundaries
      9   .bundle_align_mode 4
     10   pushq   %rbp
     11   pushq   %r14
     12   pushq   %rbx
     13 
     14   movl    %edi, %ebx
     15   callq   bar
     16   movl    %eax, %r14d
     17 
     18   imull   $17, %ebx, %ebp
     19 # This imull is 3 bytes long and should have started at 0xe, so two bytes
     20 # of nop padding are inserted instead and it starts at 0x10
     21 # CHECK:          nop
     22 # CHECK-NEXT:     10: imull
     23 
     24   movl    %ebx, %edi
     25   callq   bar
     26   cmpl    %r14d, %ebp
     27   jle     .L_ELSE
     28 # Due to the padding that's inserted before the addl, the jump target
     29 # becomes farther by one byte.
     30 # CHECK:         jle 5
     31 
     32   addl    %ebp, %eax
     33 # CHECK:          nop
     34 # CHECK-NEXT:     20: addl
     35 
     36   jmp     .L_RET
     37 .L_ELSE:
     38   imull   %ebx, %eax
     39 .L_RET:
     40   ret
     41 
     42 # Just sanity checking that data fills don't drive bundling crazy
     43   .data
     44   .byte 40
     45   .byte 98
     46 
     47 
     48