Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / bolt / test / X86 / fragmented-symbols.s
blobac2f705c64e94c89c0e4e25b916b4d246412003d
1 # Checks that symbols are allocated in correct sections, and that empty
2 # fragments are not allocated at all.
4 # REQUIRES: x86_64-linux
6 # RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o
7 # RUN: %clangxx %cxxflags %t.o -o %t.exe -Wl,-q -no-pie
8 # RUN: llvm-bolt %t.exe -o %t.bolt --split-functions --split-strategy=all \
9 # RUN: --print-split --print-only=_Z3foov 2>&1 | \
10 # RUN: FileCheck %s --check-prefix=CHECK-SPLIT
11 # RUN: llvm-nm %t.bolt | FileCheck %s --check-prefix=CHECK-COLD0
12 # RUN: llvm-objdump --syms %t.bolt | \
13 # RUN: FileCheck %s --check-prefix=CHECK-SYMS
15 # CHECK-SPLIT: .LLP0 (4 instructions, align : 1)
16 # CHECK-SPLIT: ------- HOT-COLD SPLIT POINT -------
17 # CHECK-SPLIT-EMPTY:
18 # CHECK-SPLIT-NEXT: ------- HOT-COLD SPLIT POINT -------
19 # CHECK-SPLIT-EMPTY:
20 # CHECK-SPLIT-NEXT: .LFT0 (2 instructions, align : 1)
22 # CHECK-COLD0-NOT: _Z3foov.cold.0
24 # CHECK-SYMS: .text.cold.1
25 # CHECK-SYMS-SAME: _Z3foov.cold.1
26 # CHECK-SYMS: .text.cold.2
27 # CHECK-SYMS-SAME: _Z3foov.cold.2
28 # CHECK-SYMS: .text.cold.3
29 # CHECK-SYMS-SAME: _Z3foov.cold.3
32 .text
33 .globl _Z3barv
34 .type _Z3barv, @function
35 _Z3barv: # void bar();
36 .cfi_startproc
37 ret
38 .cfi_endproc
39 .size _Z3barv, .-_Z3barv
42 .globl _Z3bazv
43 .type _Z3bazv, @function
44 _Z3bazv: # void baz() noexcept;
45 .cfi_startproc
46 ret
47 .cfi_endproc
48 .size _Z3bazv, .-_Z3bazv
51 .globl _Z3foov
52 .type _Z3foov, @function
53 _Z3foov: # void foo() noexcept;
54 .LFB1265: # _Z3foov
55 .cfi_startproc
56 .cfi_personality 0x3,__gxx_personality_v0
57 .cfi_lsda 0x3,.LLSDA1265
58 subq $8, %rsp
59 .cfi_def_cfa_offset 16
60 .LEHB0:
61 call _Z3barv # LP: .L5
62 .LEHE0:
63 jmp .L4
64 .L5: # (_Z3foov.cold.0), landing pad, hot
65 movq %rax, %rdi
66 cmpq $1, %rdx
67 je .L3
68 call _ZSt9terminatev # _Z3foov.cold.1
69 .L3: # _Z3foov.cold.2
70 call __cxa_begin_catch
71 call _Z3bazv
72 call __cxa_end_catch
73 .L4: # _Z3foov.cold.3
74 call _Z3bazv
75 addq $8, %rsp
76 .cfi_def_cfa_offset 8
77 ret
78 .cfi_endproc
79 .globl __gxx_personality_v0
80 .section .gcc_except_table,"a",@progbits
81 .align 4
82 .LLSDA1265:
83 .byte 0xff
84 .byte 0x3
85 .uleb128 .LLSDATT1265-.LLSDATTD1265
86 .LLSDATTD1265:
87 .byte 0x1
88 .uleb128 .LLSDACSE1265-.LLSDACSB1265
89 .LLSDACSB1265:
90 .uleb128 .LEHB0-.LFB1265
91 .uleb128 .LEHE0-.LEHB0
92 .uleb128 .L5-.LFB1265
93 .uleb128 0x3
94 .LLSDACSE1265:
95 .byte 0
96 .byte 0
97 .byte 0x1
98 .byte 0x7d
99 .align 4
100 .long _ZTISt13runtime_error
101 .LLSDATT1265:
102 .text
103 .size _Z3foov, .-_Z3foov
106 .globl main
107 .type main, @function
108 main:
109 .cfi_startproc
110 subq $8, %rsp
111 .cfi_def_cfa_offset 16
112 call _Z3foov
113 movl $0, %eax
114 addq $8, %rsp
115 .cfi_def_cfa_offset 8
117 .cfi_endproc
118 .size main, .-main