48 lines · plain
1# REQUIRES: x862## basic-block-sections tests.3## This simple test checks foo is folded into bar with bb sections4## and the jumps are deleted.5 6# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o7# RUN: ld.lld --optimize-bb-jumps --icf=all %t.o -o %t.out8# RUN: llvm-objdump -d %t.out| FileCheck %s9 10# CHECK: <foo>:11# CHECK-NEXT: nopl (%rax)12# CHECK-NEXT: je 0x{{[[:xdigit:]]+}} <aa.BB.foo>13# CHECK-NOT: jmp14 15# CHECK: <a.BB.foo>:16## Explicity check that bar is folded and not emitted.17# CHECK-NOT: <bar>:18# CHECK-NOT: <a.BB.bar>:19# CHECK-NOT: <aa.BB.bar>:20 21.section .text.bar,"ax",@progbits22.type bar,@function23bar:24 nopl (%rax)25 jne a.BB.bar26 jmp aa.BB.bar27 28.section .text.a.BB.bar,"ax",@progbits,unique,329a.BB.bar:30 nopl (%rax)31 32aa.BB.bar:33 ret34 35.section .text.foo,"ax",@progbits36.type foo,@function37foo:38 nopl (%rax)39 jne a.BB.foo40 jmp aa.BB.foo41 42.section .text.a.BB.foo,"ax",@progbits,unique,243a.BB.foo:44 nopl (%rax)45 46aa.BB.foo:47 ret48