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