[sanitizer] Improve FreeBSD ASLR detection
[llvm-project.git] / llvm / test / LTO / X86 / diagnostic-handler-remarks-with-hotness.ll
blob04c7a4537414c6e565916771b5fc64f4a0dae4e8
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
23 ; YAML:      --- !Passed
24 ; YAML-NEXT: Pass:            inline
25 ; YAML-NEXT: Name:            Inlined
26 ; YAML-NEXT: Function:        main
27 ; YAML-NEXT: Hotness:         300
28 ; YAML-NEXT: Args:
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:          ')'
40 ; YAML-NEXT: ...
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"
45 declare i32 @bar()
47 define i32 @foo() {
48   %a = call i32 @bar()
49   ret i32 %a
52 define i32 @main() !prof !0 {
53   %i = call i32 @foo()
54   ret i32 %i
57 !0 = !{!"function_entry_count", i64 300}