1 ; Check the basic block sections labels option
2 ; RUN: llc < %s -mtriple=x86_64 -function-sections -unique-section-names=true -basic-block-sections=labels | FileCheck %s --check-prefixes=CHECK,UNIQ
3 ; RUN: llc < %s -mtriple=x86_64 -function-sections -unique-section-names=false -basic-block-sections=labels | FileCheck %s --check-prefixes=CHECK,NOUNIQ
4 ; RUN: llc < %s -mtriple=x86_64 -function-sections -unique-section-names=true -basic-block-sections=labels -split-machine-functions | FileCheck %s --check-prefixes=CHECK,UNIQ
6 define void @_Z3bazb(i1 zeroext, i1 zeroext) personality ptr @__gxx_personality_v0 {
7 br i1 %0, label %3, label %8
10 %4 = invoke i32 @_Z3barv()
11 to label %8 unwind label %6
15 landingpad { ptr, i32 }
20 %9 = call i32 @_Z3foov()
21 br i1 %1, label %12, label %10
24 %11 = select i1 %1, ptr blockaddress(@_Z3bazb, %3), ptr blockaddress(@_Z3bazb, %12) ; <ptr> [#uses=1]
25 indirectbr ptr %11, [label %3, label %12]
31 declare i32 @_Z3barv() #1
33 declare i32 @_Z3foov() #1
35 declare i32 @__gxx_personality_v0(...)
37 ; UNIQ: .section .text._Z3bazb,"ax",@progbits{{$}}
38 ; NOUNIQ: .section .text,"ax",@progbits,unique,1
39 ; CHECK-LABEL: _Z3bazb:
40 ; CHECK-LABEL: .Lfunc_begin0:
41 ; CHECK-LABEL: .LBB_END0_0:
42 ; CHECK-LABEL: .LBB0_1:
43 ; CHECK-LABEL: .LBB_END0_1:
44 ; CHECK-LABEL: .LBB0_2:
45 ; CHECK-LABEL: .LBB_END0_2:
46 ; CHECK-LABEL: .LBB0_3:
47 ; CHECK-LABEL: .LBB_END0_3:
48 ; CHECK-LABEL: .Lfunc_end0:
50 ; UNIQ: .section .llvm_bb_addr_map,"o",@llvm_bb_addr_map,.text._Z3bazb{{$}}
51 ;; Verify that with -unique-section-names=false, the unique id of the text section gets assigned to the llvm_bb_addr_map section.
52 ; NOUNIQ: .section .llvm_bb_addr_map,"o",@llvm_bb_addr_map,.text,unique,1
53 ; CHECK-NEXT: .byte 2 # version
54 ; CHECK-NEXT: .byte 0 # feature
55 ; CHECK-NEXT: .quad .Lfunc_begin0 # function address
56 ; CHECK-NEXT: .byte 6 # number of basic blocks
57 ; CHECK-NEXT: .byte 0 # BB id
58 ; CHECK-NEXT: .uleb128 .Lfunc_begin0-.Lfunc_begin0
59 ; CHECK-NEXT: .uleb128 .LBB_END0_0-.Lfunc_begin0
61 ; CHECK-NEXT: .byte 1 # BB id
62 ; CHECK-NEXT: .uleb128 .LBB0_1-.LBB_END0_0
63 ; CHECK-NEXT: .uleb128 .LBB_END0_1-.LBB0_1
65 ; CHECK-NEXT: .byte 3 # BB id
66 ; CHECK-NEXT: .uleb128 .LBB0_2-.LBB_END0_1
67 ; CHECK-NEXT: .uleb128 .LBB_END0_2-.LBB0_2
69 ; CHECK-NEXT: .byte 4 # BB id
70 ; CHECK-NEXT: .uleb128 .LBB0_3-.LBB_END0_2
71 ; CHECK-NEXT: .uleb128 .LBB_END0_3-.LBB0_3
72 ; CHECK-NEXT: .byte 16
73 ; CHECK-NEXT: .byte 5 # BB id
74 ; CHECK-NEXT: .uleb128 .LBB0_4-.LBB_END0_3
75 ; CHECK-NEXT: .uleb128 .LBB_END0_4-.LBB0_4
77 ; CHECK-NEXT: .byte 2 # BB id
78 ; CHECK-NEXT: .uleb128 .LBB0_5-.LBB_END0_4
79 ; CHECK-NEXT: .uleb128 .LBB_END0_5-.LBB0_5