================ @@ -0,0 +1,98 @@ +# REQUIRES: x86 + +## Test that the branch-to-branch optimization follows the links +## from f1 -> f2 -> f3 and updates all references to point to f3. + +# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o +# RUN: ld.lld %t.o -o %t --branch-to-branch +# RUN: llvm-objdump -d -s %t | FileCheck --check-prefixes=CHECK,B2B %s +# RUN: ld.lld %t.o -o %t -O2 +# RUN: llvm-objdump -d -s %t | FileCheck --check-prefixes=CHECK,B2B %s + +## Test that branch-to-branch is disabled by default. + +# RUN: ld.lld %t.o -o %t +# RUN: llvm-objdump -d -s %t | FileCheck --check-prefixes=CHECK,NOB2B %s +# RUN: ld.lld %t.o -o %t -O2 --no-branch-to-branch +# RUN: llvm-objdump -d -s %t | FileCheck --check-prefixes=CHECK,NOB2B %s + +## Test that branch-to-branch is disabled for preemptible symbols. + +# RUN: ld.lld %t.o -o %t --branch-to-branch -shared +# RUN: llvm-objdump -d -s %t | FileCheck --check-prefixes=CHECK,NOB2B %s + +.section .rodata.vtable,"a" +.globl vtable +vtable: +# B2B: Contents of section .rodata: +# B2B-NEXT: [[VF:[0-9a-f]{8}]] ---------------- MaskRay wrote:
We need to check the exact value, otherwise the PLT32 with an addend not -4 is not tested. https://github.com/llvm/llvm-project/pull/138366 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits