1 ; RUN: llc < %s -mtriple=x86_64 -function-sections -basic-block-sections=labels | FileCheck %s
3 $_Z4fooTIiET_v = comdat any
5 define dso_local i32 @_Z3barv() {
8 ;; Check we add SHF_LINK_ORDER for .llvm_bb_addr_map and link it with the corresponding .text sections.
9 ; CHECK: .section .text._Z3barv,"ax",@progbits
10 ; CHECK-LABEL: _Z3barv:
11 ; CHECK-NEXT: [[BAR_BEGIN:.Lfunc_begin[0-9]+]]:
12 ; CHECK: .section .llvm_bb_addr_map,"o",@llvm_bb_addr_map,.text._Z3barv{{$}}
13 ; CHECK-NEXT: .byte 2 # version
14 ; CHECK-NEXT: .byte 0 # feature
15 ; CHECK-NEXT: .quad [[BAR_BEGIN]] # function address
18 define dso_local i32 @_Z3foov() {
19 %1 = call i32 @_Z4fooTIiET_v()
22 ; CHECK: .section .text._Z3foov,"ax",@progbits
23 ; CHECK-LABEL: _Z3foov:
24 ; CHECK-NEXT: [[FOO_BEGIN:.Lfunc_begin[0-9]+]]:
25 ; CHECK: .section .llvm_bb_addr_map,"o",@llvm_bb_addr_map,.text._Z3foov{{$}}
26 ; CHECK-NEXT: .byte 2 # version
27 ; CHECK-NEXT: .byte 0 # feature
28 ; CHECK-NEXT: .quad [[FOO_BEGIN]] # function address
31 define linkonce_odr dso_local i32 @_Z4fooTIiET_v() comdat {
34 ;; Check we add .llvm_bb_addr_map section to a COMDAT group with the corresponding .text section if such a COMDAT exists.
35 ; CHECK: .section .text._Z4fooTIiET_v,"axG",@progbits,_Z4fooTIiET_v,comdat
36 ; CHECK-LABEL: _Z4fooTIiET_v:
37 ; CHECK-NEXT: [[FOOCOMDAT_BEGIN:.Lfunc_begin[0-9]+]]:
38 ; CHECK: .section .llvm_bb_addr_map,"oG",@llvm_bb_addr_map,.text._Z4fooTIiET_v,_Z4fooTIiET_v,comdat{{$}}
39 ; CHECK-NEXT: .byte 2 # version
40 ; CHECK-NEXT: .byte 0 # feature
41 ; CHECK-NEXT: .quad [[FOOCOMDAT_BEGIN]] # function address