1 ; RUN: llc < %s -mtriple=x86_64-pc-linux -basic-block-sections=all | FileCheck %s
2 ; RUN: llc < %s -mtriple=x86_64-pc-linux -function-sections -basic-block-sections=all | FileCheck %s
3 ; RUN: echo "!_Z3fooi" > %t.order.txt
4 ; RUN: echo "!!2" >> %t.order.txt
5 ; RUN: llc < %s -mtriple=x86_64-pc-linux -basic-block-sections=%t.order.txt | FileCheck %s --check-prefix=LIST
6 ; RUN: llc < %s -mtriple=x86_64-pc-linux -function-sections -basic-block-sections=%t.order.txt | FileCheck %s --check-prefix=LIST
8 ; CHECK: .section foo_section,"ax",@progbits,unique,1
9 ; CHECK-LABEL: _Z3fooi:
10 ; CHECK: .section foo_section,"ax",@progbits,unique,2
11 ; CHECK-NEXT: _Z3fooi.__part.1:
12 ; CHECK: .section foo_section,"ax",@progbits,unique,3
13 ; CHECK-NEXT: _Z3fooi.__part.2:
15 ; LIST: .section foo_section,"ax",@progbits,unique,1
16 ; LIST-LABEL: _Z3fooi:
17 ; LIST: .section foo_section,"ax",@progbits,unique,2
18 ; LIST-NEXT: _Z3fooi.__part.0:
19 ; LIST-NOT: .section foo_section,"ax",@progbits,unique,3
21 ;; Source to generate the IR:
22 ;; __attribute__((section("foo_section")))
29 define dso_local i32 @_Z3fooi(i32 %n) local_unnamed_addr section "foo_section" {
31 %cmp = icmp slt i32 %n, 0
32 br i1 %cmp, label %if.then, label %if.end
34 if.then: ; preds = %entry
35 tail call void @exit(i32 -1) #2
38 if.end: ; preds = %entry
42 declare dso_local void @exit(i32) local_unnamed_addr