Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / llvm / test / MC / X86 / align-branch-single.s
blobeb6bb011addaff03f17fed1b17bf65b184abc460
1 # RUN: llvm-mc -filetype=obj -triple x86_64 --x86-align-branch-boundary=32 --x86-align-branch=jcc %s | llvm-objdump -d --no-show-raw-insn - | FileCheck %s --check-prefixes=JCC
2 # RUN: llvm-mc -filetype=obj -triple x86_64 --x86-align-branch-boundary=32 --x86-align-branch=jmp %s | llvm-objdump -d --no-show-raw-insn - | FileCheck %s --check-prefixes=JMP
3 # RUN: llvm-mc -filetype=obj -triple x86_64 --x86-align-branch-boundary=32 --x86-align-branch=indirect %s | llvm-objdump -d --no-show-raw-insn - | FileCheck %s --check-prefixes=IND
4 # RUN: llvm-mc -filetype=obj -triple x86_64 --x86-align-branch-boundary=32 --x86-align-branch=call %s | llvm-objdump -d --no-show-raw-insn - | FileCheck %s --check-prefixes=CAL
5 # RUN: llvm-mc -filetype=obj -triple x86_64 --x86-align-branch-boundary=32 --x86-align-branch=ret %s | llvm-objdump -d --no-show-raw-insn - | FileCheck %s --check-prefixes=RET
7 # Exercise cases where only one kind of instruction is asked to be aligned.
8 # Fused instruction cases are excluded.
10 .text
11 .globl foo
12 .p2align 5
13 foo:
14 .p2align 5
15 .rept 30
16 int3
17 .endr
18 # JCC: 20: jne
19 # JMP: 1e: jne
20 # IND: 1e: jne
21 # CAL: 1e: jne
22 # RET: 1e: jne
23 jne foo
24 int3
26 .p2align 5
27 .rept 30
28 int3
29 .endr
30 # JCC: 5e: jmp
31 # JMP: 60: jmp
32 # IND: 5e: jmp
33 # CAL: 5e: jmp
34 # RET: 5e: jmp
35 jmp foo
36 int3
38 .p2align 5
39 .rept 30
40 int3
41 .endr
42 # JCC: 9e: jmpq *%rax
43 # JMP: 9e: jmpq *%rax
44 # IND: a0: jmpq *%rax
45 # CAL: 9e: jmpq *%rax
46 # RET: 9e: jmpq *%rax
47 jmp *%rax
48 int3
51 .p2align 5
52 .rept 30
53 int3
54 .endr
55 # JCC: de: callq *%rax
56 # JMP: de: callq *%rax
57 # IND: de: callq *%rax
58 # CAL: e0: callq *%rax
59 # RET: de: callq *%rax
60 call *%rax
61 int3
64 .p2align 5
65 .rept 30
66 int3
67 .endr
68 # JCC: 11e: retq
69 # JMP: 11e: retq
70 # IND: 11e: retq
71 # CAL: 11e: retq
72 # RET: 120: retq
73 ret $0
74 int3
77 .p2align 5
78 .rept 29
79 int3
80 .endr
81 # JCC: 15d: cmpq %rax, %rbp
82 # JCC: 160: je
83 # JMP: 15d: cmpq %rax, %rbp
84 # JMP: 160: je
85 # IND: 15d: cmpq %rax, %rbp
86 # IND: 160: je
87 # CAL: 15d: cmpq %rax, %rbp
88 # CAL: 160: je
89 # RET: 15d: cmpq %rax, %rbp
90 # RET: 160: je
91 cmp %rax, %rbp
92 je foo
93 int3