2 ## basic-block-sections tests.
3 ## This simple test checks if redundant direct jumps are converted to
4 ## implicit fallthrus. The jcc's must be converted to their inverted
5 ## opcode, for instance jne to je and jmp must be deleted.
7 # RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
8 # RUN: ld.lld --optimize-bb-jumps %t.o -o %t.out
9 # RUN: llvm-objdump -d %t.out| FileCheck %s
12 # CHECK-NEXT: nopl (%rax)
13 # CHECK-NEXT: jne 0x{{[[:xdigit:]]+}} <r.BB.foo>
17 .section .text,"ax",@progbits
25 # CHECK-NEXT: nopl (%rax)
26 # CHECK-NEXT: je 0x{{[[:xdigit:]]+}} <r.BB.foo>
29 .section .text,"ax",@progbits,unique,3
36 # CHECK-NEXT: nopl (%rax)
37 # CHECK-NEXT: jle 0x{{[[:xdigit:]]+}} <r.BB.foo>
40 .section .text,"ax",@progbits,unique,4
46 # CHECK: <aaa.BB.foo>:
47 # CHECK-NEXT: nopl (%rax)
48 # CHECK-NEXT: jl 0x{{[[:xdigit:]]+}} <r.BB.foo>
51 .section .text,"ax",@progbits,unique,5
57 # CHECK: <aaaa.BB.foo>:
58 # CHECK-NEXT: nopl (%rax)
59 # CHECK-NEXT: jae 0x{{[[:xdigit:]]+}} <r.BB.foo>
62 .section .text,"ax",@progbits,unique,6
68 # CHECK: <aaaaa.BB.foo>:
69 # CHECK-NEXT: nopl (%rax)
70 # CHECK-NEXT: ja 0x{{[[:xdigit:]]+}} <r.BB.foo>
73 .section .text,"ax",@progbits,unique,7
79 # CHECK: <aaaaaa.BB.foo>:
80 # CHECK-NEXT: nopl (%rax)
81 # CHECK-NEXT: jge 0x{{[[:xdigit:]]+}} <r.BB.foo>
84 .section .text,"ax",@progbits,unique,8
90 # CHECK: <aaaaaaa.BB.foo>:
91 # CHECK-NEXT: nopl (%rax)
92 # CHECK-NEXT: jg 0x{{[[:xdigit:]]+}} <r.BB.foo>
95 .section .text,"ax",@progbits,unique,9
101 # CHECK: <aaaaaaaa.BB.foo>:
102 # CHECK-NEXT: nopl (%rax)
103 # CHECK-NEXT: jbe 0x{{[[:xdigit:]]+}} <r.BB.foo>
106 .section .text,"ax",@progbits,unique,10
112 # CHECK: <aaaaaaaaa.BB.foo>:
113 # CHECK-NEXT: nopl (%rax)
114 # CHECK-NEXT: jb 0x{{[[:xdigit:]]+}} <r.BB.foo>
117 .section .text,"ax",@progbits,unique,11
120 jae aaaaaaaaaa.BB.foo
123 .section .text,"ax",@progbits,unique,20