brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.1 KiB · da3b4f2 Raw
55 lines · plain
1;; Tests for basic block sections applied on a function in a custom section.2; RUN: llc < %s -mtriple=x86_64-pc-linux -basic-block-sections=all | FileCheck %s3; RUN: llc < %s -mtriple=x86_64-pc-linux -function-sections -basic-block-sections=all | FileCheck %s4; RUN: echo "!_Z3fooi" > %t1.list.txt5; RUN: echo "!!2" >> %t1.list.txt6; RUN: llc < %s -mtriple=x86_64-pc-linux -basic-block-sections=%t1.list.txt | FileCheck %s --check-prefix=LIST17; RUN: llc < %s -mtriple=x86_64-pc-linux -function-sections -basic-block-sections=%t1.list.txt | FileCheck %s --check-prefix=LIST18; RUN: echo "!_Z3fooi" > %t2.list.txt9; RUN: echo "!!0" >> %t2.list.txt10; RUN: llc < %s -mtriple=x86_64-pc-linux -basic-block-sections=%t2.list.txt | FileCheck %s --check-prefix=LIST211; RUN: llc < %s -mtriple=x86_64-pc-linux -function-sections -basic-block-sections=%t2.list.txt | FileCheck %s --check-prefix=LIST212 13 14; CHECK: .section	foo_section,"ax",@progbits,unique,115; CHECK-LABEL: _Z3fooi:16; CHECK: .section	foo_section,"ax",@progbits,unique,217; CHECK-NEXT: _Z3fooi.__part.1:18; CHECK: .section	foo_section,"ax",@progbits,unique,319; CHECK-NEXT: _Z3fooi.__part.2:20 21; LIST1: .section	foo_section,"ax",@progbits,unique,122; LIST1-LABEL: _Z3fooi:23; LIST1: .section	foo_section,"ax",@progbits,unique,224; LIST1-NEXT: _Z3fooi.__part.0:25; LIST1-NOT: .section	foo_section,"ax",@progbits,unique,326 27; LIST2: .section	foo_section,"ax",@progbits,unique,128; LIST2-LABEL: _Z3fooi:29; LIST2: .section	foo_section,"ax",@progbits,unique,230; LIST2-NEXT: _Z3fooi.cold:31; LIST2-NOT: .section	foo_section,"ax",@progbits,unique,332 33;; Source to generate the IR:34;; #pragma clang section text = "foo_section"35;; int foo(int n) {36;;   if (n < 0)37;;     exit(-1);38;;   return 0;39;; }40 41define dso_local i32 @_Z3fooi(i32 %n) local_unnamed_addr section "foo_section" {42entry:43  %cmp = icmp slt i32 %n, 044  br i1 %cmp, label %if.then, label %if.end45 46if.then:                                          ; preds = %entry47  tail call void @exit(i32 -1) #248  unreachable49 50if.end:                                           ; preds = %entry51  ret i32 052}53 54declare dso_local void @exit(i32) local_unnamed_addr55