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: --data %t.fdata -o %t.out | FileCheck %s
19 # CHECK: BOLT-INFO: setting __hot_end to
21 # RUN: llvm-nm -n %t.exe | FileCheck %s --check-prefix=CHECK-INPUT
22 # RUN: llvm-nm -n %t.out | FileCheck %s --check-prefix=CHECK-OUTPUT
24 # CHECK-INPUT: __hot_start
25 # CHECK-INPUT-NEXT: main
26 # CHECK-INPUT-NEXT: foo
27 # CHECK-INPUT-NEXT: __hot_end
29 # Our fdata only logs activity in main, so hot markers will change
30 # CHECK-OUTPUT: __hot_start
31 # CHECK-OUTPUT-NEXT: main
32 # CHECK-OUTPUT-NEXT: __hot_end
38 .type __hot_start, %object
42 # FDATA: 0 [unknown] 0 1 main 0 0 510
66 .type __hot_end, %object
80 mystring
: .asciz "test\n"