1 ; Check that the hotness attribute is included in the optimization record file
2 ; with -lto-pass-remarks-with-hotness.
4 ; RUN: llvm-as < %s >%t.bc
5 ; RUN: rm -f %t.yaml %t.t300.yaml %t.t301.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
11 ; RUN: llvm-lto -lto-pass-remarks-output=%t.t300.yaml \
12 ; RUN: -lto-pass-remarks-with-hotness \
13 ; RUN: -lto-pass-remarks-hotness-threshold=300 \
14 ; RUN: -exported-symbol _main -o %t.o %t.bc
15 ; RUN: FileCheck -check-prefix=YAML %s < %t.t300.yaml
17 ; RUN: llvm-lto -lto-pass-remarks-output=%t.t301.yaml \
18 ; RUN: -lto-pass-remarks-with-hotness \
19 ; RUN: -lto-pass-remarks-hotness-threshold=301 \
20 ; RUN: -exported-symbol _main -o %t.o %t.bc
21 ; RUN: not FileCheck -check-prefix=YAML %s < %t.t301.yaml
24 ; YAML-NEXT: Pass: inline
25 ; YAML-NEXT: Name: Inlined
26 ; YAML-NEXT: Function: main
27 ; YAML-NEXT: Hotness: 300
29 ; YAML-NEXT: - String: ''''
30 ; YAML-NEXT: - Callee: foo
31 ; YAML-NEXT: - String: ''' inlined into '''
32 ; YAML-NEXT: - Caller: main
33 ; YAML-NEXT: - String: ''''
34 ; YAML-NEXT: - String: ' with '
35 ; YAML-NEXT: - String: '(cost='
36 ; YAML-NEXT: - Cost: '-15000'
37 ; YAML-NEXT: - String: ', threshold='
38 ; YAML-NEXT: - Threshold: '337'
39 ; YAML-NEXT: - String: ')'
42 target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
43 target triple = "x86_64-apple-darwin"
52 define i32 @main() !prof !0 {
57 !0 = !{!"function_entry_count", i64 300}