43 lines · plain
1; RUN: llc < %s -mtriple=x86_64-pc-linux -basic-block-sections=all | FileCheck %s2; RUN: llc < %s -mtriple=x86_64-pc-linux -function-sections -basic-block-sections=all | FileCheck %s3; RUN: echo "!_Z3fooi" > %t.order.txt4; RUN: echo "!!2" >> %t.order.txt5; RUN: llc < %s -mtriple=x86_64-pc-linux -basic-block-sections=%t.order.txt | FileCheck %s --check-prefix=LIST6; RUN: llc < %s -mtriple=x86_64-pc-linux -function-sections -basic-block-sections=%t.order.txt | FileCheck %s --check-prefix=LIST7 8; CHECK: .section foo_section,"ax",@progbits,unique,19; CHECK-LABEL: _Z3fooi:10; CHECK: .section foo_section,"ax",@progbits,unique,211; CHECK-NEXT: _Z3fooi.__part.1:12; CHECK: .section foo_section,"ax",@progbits,unique,313; CHECK-NEXT: _Z3fooi.__part.2:14 15; LIST: .section foo_section,"ax",@progbits,unique,116; LIST-LABEL: _Z3fooi:17; LIST: .section foo_section,"ax",@progbits,unique,218; LIST-NEXT: _Z3fooi.__part.0:19; LIST-NOT: .section foo_section,"ax",@progbits,unique,320 21;; Source to generate the IR:22;; __attribute__((section("foo_section")))23;; int foo(int n) {24;; if (n < 0)25;; exit(-1);26;; return 0;27;; }28 29define dso_local i32 @_Z3fooi(i32 %n) local_unnamed_addr section "foo_section" {30entry:31 %cmp = icmp slt i32 %n, 032 br i1 %cmp, label %if.then, label %if.end33 34if.then: ; preds = %entry35 tail call void @exit(i32 -1) #236 unreachable37 38if.end: ; preds = %entry39 ret i32 040}41 42declare dso_local void @exit(i32) local_unnamed_addr43