brintos

brintos / llvm-project-archived public Read only

0
0
Text · 879 B · 0c29f5c Raw
35 lines · plain
1# This test is to verify that BOLT won't take a label pointing to constant2# island as a secondary entry point (function `_start` doesn't have ELF size3# set originally) and the function won't otherwise be mistaken as non-simple.4 5# RUN: %clang %cflags -pie %s -o %t.so -Wl,-q -Wl,--init=_foo -Wl,--fini=_foo6# RUN: llvm-bolt %t.so -o %t.bolt.so --print-cfg 2>&1 | FileCheck %s7# CHECK-NOT: BOLT-WARNING: reference in the middle of instruction detected \8# CHECK-NOT:   function _start at offset 0x{{[0-9a-f]+}}9# CHECK: Binary Function "_start" after building cfg10 11  .text12 13  .global _foo14  .type _foo, %function15_foo:16  ret17 18  .global _start19  .type _start, %function20_start:21  j _foo22 23  .balign 1624_random_consts:25  .long 0x1234567826  .long 0x90abcdef27 28  .global _bar29  .type _bar, %function30_bar:31  ret32 33  # Dummy relocation to force relocation mode34  .reloc 0, R_RISCV_NONE35