Skip to content

Commit d0ab0b5

Browse files
committed
Add test.
1 parent 8ac920d commit d0ab0b5

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
;; Check that specifying the function in the basic block sections profile
2+
;; without any other directives is a noop.
3+
;;
4+
;; Specify the bb sections profile:
5+
; RUN: echo 'v1' > %t
6+
; RUN: echo 'f _Z3foob' >> %t
7+
; RUN: echo 't 0@0' >> %t
8+
;;
9+
; RUN: llc < %s -mtriple=x86_64-pc-linux -function-sections -basic-block-sections=%t | FileCheck
10+
11+
define i32 @_Z3foob(i1 zeroext %0) nounwind {
12+
%2 = alloca i32, align 4
13+
%3 = alloca i8, align 1
14+
%4 = zext i1 %0 to i8
15+
store i8 %4, ptr %3, align 1
16+
%5 = load i8, ptr %3, align 1
17+
%6 = trunc i8 %5 to i1
18+
%7 = zext i1 %6 to i32
19+
%8 = icmp sgt i32 %7, 0
20+
br i1 %8, label %9, label %11
21+
22+
9: ; preds = %1
23+
%10 = call i32 @_Z3barv()
24+
store i32 %10, ptr %2, align 4
25+
br label %13
26+
27+
11: ; preds = %1
28+
%12 = call i32 @_Z3bazv()
29+
store i32 %12, ptr %2, align 4
30+
br label %13
31+
32+
13: ; preds = %11, %9
33+
%14 = load i32, ptr %2, align 4
34+
ret i32 %14
35+
}
36+
37+
declare i32 @_Z3barv() #1
38+
declare i32 @_Z3bazv() #1
39+
40+
41+
; CHECK: _Z3foob
42+
; CHECK: llvm_prefetch_target

0 commit comments

Comments
 (0)