1 ;; Check that the -basic-block-address-map option works when used along with -basic-block-sections.
2 ;; Let a function with 4 basic blocks get split into 2 sections.
3 ; RUN: echo '!_Z3bazb' > %t
4 ; RUN: echo '!!0 2' >> %t
5 ; RUN: llc < %s -mtriple=x86_64 -basic-block-address-map -basic-block-sections=%t | FileCheck %s
7 define void @_Z3bazb(i1 zeroext) personality ptr @__gxx_personality_v0 {
8 br i1 %0, label %2, label %7
11 %3 = invoke i32 @_Z3barv()
12 to label %7 unwind label %5
16 landingpad { ptr, i32 }
21 %8 = call i32 @_Z3foov()
28 declare i32 @_Z3barv() #1
30 declare i32 @_Z3foov() #1
32 declare i32 @__gxx_personality_v0(...)
35 ; CHECK-LABEL: _Z3bazb:
36 ; CHECK-LABEL: .Lfunc_begin0:
37 ; CHECK-LABEL: .LBB_END0_0:
38 ; CHECK-LABEL: .LBB0_1:
39 ; CHECK-LABEL: .LBB_END0_1:
40 ; CHECK: .section .text.split._Z3bazb,"ax",@progbits
41 ; CHECK-LABEL: _Z3bazb.cold:
42 ; CHECK-LABEL: .LBB_END0_2:
43 ; CHECK-LABEL: .LBB0_3:
44 ; CHECK-LABEL: .LBB_END0_3:
45 ; CHECK-LABEL: .Lfunc_end0:
47 ; CHECK: .section .llvm_bb_addr_map,"o",@llvm_bb_addr_map,.text.hot._Z3bazb
48 ; CHECK-NEXT: .byte 2 # version
49 ; CHECK-NEXT: .byte 8 # feature
50 ; CHECK-NEXT: .byte 2 # number of basic block ranges
51 ; CHECK-NEXT: .quad .Lfunc_begin0 # base address
52 ; CHECK-NEXT: .byte 2 # number of basic blocks
53 ; CHECK-NEXT: .byte 0 # BB id
54 ; CHECK-NEXT: .uleb128 .Lfunc_begin0-.Lfunc_begin0
55 ; CHECK-NEXT: .uleb128 .LBB_END0_0-.Lfunc_begin0
57 ; CHECK-NEXT: .byte 2 # BB id
58 ; CHECK-NEXT: .uleb128 .LBB0_1-.LBB_END0_0
59 ; CHECK-NEXT: .uleb128 .LBB_END0_1-.LBB0_1
61 ; CHECK-NEXT: .quad _Z3bazb.cold # base address
62 ; CHECK-NEXT: .byte 2 # number of basic blocks
63 ; CHECK-NEXT: .byte 1 # BB id
64 ; CHECK-NEXT: .uleb128 _Z3bazb.cold-_Z3bazb.cold
65 ; CHECK-NEXT: .uleb128 .LBB_END0_2-_Z3bazb.cold
67 ; CHECK-NEXT: .byte 3 # BB id
68 ; CHECK-NEXT: .uleb128 .LBB0_3-.LBB_END0_2
69 ; CHECK-NEXT: .uleb128 .LBB_END0_3-.LBB0_3