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 - | FileCheck %s
      3 # RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu -mc-relax-all %s -o - \
      4 # RUN:   | llvm-objdump -disassemble - | FileCheck %s
      5 
      6 # Test that instructions inside bundle-locked groups are relaxed even if their
      7 # fixup is short enough not to warrant relaxation on its own.
      8 
      9   .text
     10 foo:
     11   .bundle_align_mode 4
     12   pushq   %rbp
     13 
     14   movl    %edi, %ebx
     15   callq   bar
     16   movl    %eax, %r14d
     17   imull   $17, %ebx, %ebp
     18   movl    %ebx, %edi
     19   callq   bar
     20   cmpl    %r14d, %ebp
     21   .bundle_lock
     22 
     23   jle     .L_ELSE
     24 # This group would've started at 0x18 and is too long, so a chunky NOP padding
     25 # is inserted to push it to 0x20.
     26 # CHECK: 18: {{[a-f0-9 ]+}} nopl
     27 
     28 # The long encoding for JLE should be used here even though its target is close
     29 # CHECK-NEXT: 20: 0f 8e
     30 
     31   addl    %ebp, %eax
     32 
     33   jmp     .L_RET
     34 # Same for the JMP
     35 # CHECK: 28: e9
     36 
     37   .bundle_unlock
     38 
     39 .L_ELSE:
     40   imull   %ebx, %eax
     41 .L_RET:
     42 
     43   popq    %rbx
     44 
     45