OSDN Git Service

Enrich inline messages
[android-x86/external-llvm.git] / test / LTO / X86 / diagnostic-handler-remarks-with-hotness.ll
1 ; Check that the hotness attribute is included in the optimization record file
2 ; with -lto-pass-remarks-with-hotness.
3
4 ; RUN: llvm-as < %s >%t.bc
5 ; RUN: rm -f %t.yaml
6 ; RUN: llvm-lto -lto-pass-remarks-output=%t.yaml \
7 ; RUN:          -lto-pass-remarks-with-hotness \
8 ; RUN:          -exported-symbol _main -o %t.o %t.bc
9 ; RUN: cat %t.yaml | FileCheck -check-prefix=YAML %s
10
11 ; YAML:      --- !Passed
12 ; YAML-NEXT: Pass:            inline
13 ; YAML-NEXT: Name:            Inlined
14 ; YAML-NEXT: Function:        main
15 ; YAML-NEXT: Hotness:         300
16 ; YAML-NEXT: Args:
17 ; YAML-NEXT:   - Callee:          foo
18 ; YAML-NEXT:   - String:          ' inlined into '
19 ; YAML-NEXT:   - Caller:          main
20 ; YAML-NEXT:   - String:          ' with '
21 ; YAML-NEXT:   - String:          '(cost='
22 ; YAML-NEXT:   - Cost:            '-15000'
23 ; YAML-NEXT:   - String:          ', threshold='
24 ; YAML-NEXT:   - Threshold:       '337'
25 ; YAML-NEXT:   - String:          ')'
26 ; YAML-NEXT: ...
27
28 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
29 target triple = "x86_64-apple-darwin"
30
31 declare i32 @bar()
32
33 define i32 @foo() {
34   %a = call i32 @bar()
35   ret i32 %a
36 }
37
38 define i32 @main() !prof !0 {
39   %i = call i32 @foo()
40   ret i32 %i
41 }
42
43 !0 = !{!"function_entry_count", i64 300}