[flang] Update CommandTest for AIX (NFC) (#118403)
[llvm-project.git] / bolt / test / runtime / X86 / hot-end-symbol.s
blob6ae771cead75682010dbd0739682f00b4f30239a
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 \
9 # RUN: %s -o %t.o
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
18 # RUN: %t.out 1
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
36 .text
37 .globl main
38 .type main, %function
39 .globl __hot_start
40 .p2align 4
41 main:
42 __hot_start:
43 # FDATA: 0 [unknown] 0 1 main 0 0 510
44 pushq %rbp
45 movq %rsp, %rbp
46 cmpl $0x2, %edi
47 jb .BBend
48 .BB2:
49 callq bar
50 leaq mystring, %rdi
51 callq puts
53 .BBend:
54 xorq %rax, %rax
55 leaveq
56 retq
57 .size main, .-main
59 .globl foo
60 .type foo, %function
61 .p2align 4
62 foo:
63 retq
64 .size foo, .-foo
66 .globl __hot_end
67 .type __hot_end, %object
68 .p2align 2
69 __hot_end:
70 int3
71 .size __hot_end, 0
73 .globl bar
74 .type bar, %function
75 .p2align 4
76 bar:
77 retq
78 .size bar, .-bar
80 .data
81 mystring: .asciz "test\n"