1 # This reproduces a bug where BOLT would read __hot_end as
2 # the name of a function even when -hot-text is used, which
3 # means BOLT will emit another __hot_end label, eventually
4 # asserting due to a symbol redefinition in MCStreamer.
6 # REQUIRES: system-linux
8 # RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown \
10 # RUN: link_fdata %s %t.o %t.fdata
11 # RUN: llvm-strip --strip-unneeded %t.o
12 # RUN: %clang %cflags -no-pie %t.o -o %t.exe -Wl,-q
14 # RUN: llvm-bolt %t.exe --relocs=1 --hot-text --reorder-functions=hfsort \
15 # RUN: --split-functions --split-strategy=all \
16 # RUN: --data %t.fdata -o %t.out | FileCheck %s
20 # CHECK: BOLT-INFO: setting __hot_end to
22 # RUN: llvm-nm -n %t.exe | FileCheck %s --check-prefix=CHECK-INPUT
23 # RUN: llvm-nm -n %t.out | FileCheck %s --check-prefix=CHECK-OUTPUT
25 # CHECK-INPUT: __hot_start
26 # CHECK-INPUT-NEXT: main
27 # CHECK-INPUT-NEXT: foo
28 # CHECK-INPUT-NEXT: __hot_end
30 # Our fdata only logs activity in main, so hot markers will change
31 # CHECK-OUTPUT: __hot_start
32 # CHECK-OUTPUT-NEXT: main
33 # CHECK-OUTPUT-NEXT: __hot_end
34 # CHECK-OUTPUT-NOT: __hot_start.cold
43 # FDATA: 0 [unknown] 0 1 main 0 0 510
67 .type __hot_end, %object
81 mystring
: .asciz "test\n"