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