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 %s
2 # 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 %s
4 # Exercise cases where we are allowed to increase the length of unrelaxable
5 # instructions (by adding prefixes) for alignment purposes.
7 # The first test checks instructions 'int3', 'push %rbp', which will be padded
8 # later are unrelaxable (their encoding size is still 1 byte when
9 # --mc-relax-all is passed).
11 .globl labeled_unrelaxable_test
12 labeled_unrelaxable_test
:
13 # RELAX-ALL: 0: cc int3
14 # RELAX-ALL: 1: 54 pushq %rsp
18 # The second test is a basic test, we just check the jmp is aligned by prefix
19 # padding the previous instructions.
21 .globl labeled_basic_test
27 # CHECK: 3c: 2e cc int3
28 # CHECK: 3e: 2e 54 pushq %rsp
29 # CHECK: 40: eb 00 jmp
36 # The third test check the correctness cornercase - can't add prefixes on a
37 # prefix or a instruction following by a prefix.
38 .globl labeled_prefix_test
44 # CHECK: 7c: 2e cc int3
46 # CHECK: 7e: 3e cc int3
49 # CHECK: 80: eb 00 jmp