brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · 4720e35 Raw
53 lines · plain
1  # RUN: llvm-mc -mcpu=skylake -filetype=obj -triple x86_64-pc-linux-gnu %s -x86-pad-max-prefix-size=1 --x86-align-branch-boundary=32 --x86-align-branch=jmp+indirect | llvm-objdump -d - | FileCheck %s2  # RUN: llvm-mc -mcpu=skylake -filetype=obj -triple x86_64-pc-linux-gnu %s --mc-relax-all | llvm-objdump -d - | FileCheck --check-prefixes=RELAX-ALL %s3 4  # Exercise cases where we are allowed to increase the length of unrelaxable5  # instructions (by adding prefixes) for alignment purposes.6 7  # The first test checks instructions 'int3', 'push %rbp', which will be padded8  # later are unrelaxable (their encoding size is still 1 byte when9  # --mc-relax-all is passed).10  .text11  .globl labeled_unrelaxable_test12labeled_unrelaxable_test:13# RELAX-ALL:       0: cc                               int314# RELAX-ALL:       1: 54                               pushq    %rsp15  int316  push %rsp17 18  # The second test is a basic test, we just check the jmp is aligned by prefix19  # padding the previous instructions.20  .text21  .globl labeled_basic_test22labeled_basic_test:23  .p2align 524  .rept 2825  int326  .endr27# CHECK:      3c: 2e cc                            int328# CHECK:      3e: 2e 54                            pushq    %rsp29# CHECK:      40: eb 00                            jmp30  int331  push %rsp32  jmp foo33foo:34  ret35 36   # The third test check the correctness cornercase - can't add prefixes on a37   # prefix or a instruction following by a prefix.38  .globl labeled_prefix_test39labeled_prefix_test:40  .p2align 541  .rept 2842  int343  .endr44# CHECK:      7c: 2e cc                            int345  int346# CHECK:      7e: 3e cc                            int347  DS48  int349# CHECK:      80: eb 00                            jmp50  jmp bar51bar:52  ret53