1 ; Check that the basic block sections suffix naming does not conflict with __cxx_global_var_init.N naming.
2 ; How to generate this file:
8 ;; extern bool bar(int);
9 ;; A g_a(bar(5) ? bar(3) : false), g_b(true);
11 ;; $ clang -O1 -emit-llvm -S
13 ; __cxx_global_var_init has multiple basic blocks which will produce many sections.
14 ; RUN: llc < %s -mtriple=x86_64-pc-linux -function-sections -basic-block-sections=all -unique-basic-block-section-names | FileCheck %s
16 ; CHECK-LABEL: __cxx_global_var_init:
17 ; CHECK-LABEL: __cxx_global_var_init.__part.1:
18 ; CHECK-LABEL: __cxx_global_var_init.1:
20 %class.A = type { i8 }
22 $_ZN1AC2Eb = comdat any
24 @g_a = dso_local global %class.A zeroinitializer, align 1
25 @g_b = dso_local global %class.A zeroinitializer, align 1
26 @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 65535, ptr @_GLOBAL__sub_I_symcollision.cc, ptr null }]
28 define internal fastcc void @__cxx_global_var_init() unnamed_addr section ".text.startup" {
30 %call = call zeroext i1 @_Z3bari(i32 5)
31 br i1 %call, label %cond.true, label %cond.end
33 cond.true: ; preds = %entry
34 %call1 = call zeroext i1 @_Z3bari(i32 3)
37 cond.end: ; preds = %entry, %cond.true
38 %cond = phi i1 [ %call1, %cond.true ], [ false, %entry ]
39 call void @_ZN1AC2Eb(ptr nonnull @g_a, i1 zeroext %cond)
43 declare dso_local zeroext i1 @_Z3bari(i32) local_unnamed_addr
45 define linkonce_odr dso_local void @_ZN1AC2Eb(ptr %this, i1 zeroext %a) unnamed_addr comdat align 2 {
50 define internal fastcc void @__cxx_global_var_init.1() unnamed_addr section ".text.startup" {
52 call void @_ZN1AC2Eb(ptr nonnull @g_b, i1 zeroext true)
56 define internal void @_GLOBAL__sub_I_symcollision.cc() section ".text.startup" {
58 call fastcc void @__cxx_global_var_init()
59 call fastcc void @__cxx_global_var_init.1()