1 ; RUN: opt < %s -S -inline -pass-remarks-output=%t -pass-remarks=inline \
2 ; RUN: -pass-remarks-missed=inline -pass-remarks-analysis=inline \
3 ; RUN: -pass-remarks-with-hotness 2>&1 | FileCheck %s
4 ; RUN: cat %t | FileCheck -check-prefix=YAML %s
6 ; RUN: opt < %s -S -passes=inline -pass-remarks-output=%t -pass-remarks=inline \
7 ; RUN: -pass-remarks-missed=inline -pass-remarks-analysis=inline \
8 ; RUN: -pass-remarks-with-hotness 2>&1 | FileCheck %s
9 ; RUN: cat %t | FileCheck -check-prefix=YAML %s
11 ; RUN: opt < %s -S -passes=inliner-wrapper -pass-remarks-output=%t -pass-remarks=inline \
12 ; RUN: -pass-remarks-missed=inline -pass-remarks-analysis=inline \
13 ; RUN: -pass-remarks-with-hotness 2>&1 | FileCheck %s
14 ; RUN: cat %t | FileCheck -check-prefix=YAML %s
16 ; Check the YAML file for inliner-generated passed and analysis remarks. This
19 ; 1 int foo() { return 1; }
25 ; CHECK: remark: /tmp/s.c:4:10: 'foo' inlined into 'bar' with (cost={{[0-9\-]+}}, threshold={{[0-9]+}}) at callsite bar:1:10; (hotness: 30)
28 ; YAML-NEXT: Pass: inline
29 ; YAML-NEXT: Name: Inlined
30 ; YAML-NEXT: DebugLoc: { File: '/tmp/s.c', Line: 4, Column: 10 }
31 ; YAML-NEXT: Function: bar
32 ; YAML-NEXT: Hotness: 30
34 ; YAML-NEXT: - String: ''''
35 ; YAML-NEXT: - Callee: foo
36 ; YAML-NEXT: DebugLoc: { File: '/tmp/s.c', Line: 1, Column: 0 }
37 ; YAML-NEXT: - String: ''' inlined into '''
38 ; YAML-NEXT: - Caller: bar
39 ; YAML-NEXT: DebugLoc: { File: '/tmp/s.c', Line: 3, Column: 0 }
40 ; YAML-NEXT: - String: ''''
41 ; YAML-NEXT: - String: ' with '
42 ; YAML-NEXT: - String: '(cost='
43 ; YAML-NEXT: - Cost: '{{[0-9\-]+}}'
44 ; YAML-NEXT: - String: ', threshold='
45 ; YAML-NEXT: - Threshold: '{{[0-9]+}}'
46 ; YAML-NEXT: - String: ')'
47 ; YAML-NEXT: - String: ' at callsite '
48 ; YAML-NEXT: - String: bar
49 ; YAML-NEXT: - String: ':'
50 ; YAML-NEXT: - Line: '1'
51 ; YAML-NEXT: - String: ':'
52 ; YAML-NEXT: - Column: '10'
53 ; YAML-NEXT: - String: ';'
56 ; ModuleID = '/tmp/s.c'
57 source_filename = "/tmp/s.c"
58 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
59 target triple = "x86_64-apple-macosx10.11.0"
61 ; Function Attrs: nounwind ssp uwtable
62 define i32 @foo() #0 !dbg !7 {
67 ; Function Attrs: nounwind ssp uwtable
68 define i32 @bar() #0 !dbg !10 !prof !13 {
70 %call = call i32 @foo(), !dbg !11
71 ret i32 %call, !dbg !12
74 attributes #0 = { nounwind ssp uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="core2" "target-features"="+cx16,+fxsr,+mmx,+sse,+sse2,+sse3,+ssse3,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
77 !llvm.module.flags = !{!3, !4, !5}
80 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 4.0.0 (trunk 282540) (llvm/trunk 282542)", isOptimized: true, runtimeVersion: 0, emissionKind: LineTablesOnly, enums: !2)
81 !1 = !DIFile(filename: "/tmp/s.c", directory: "/tmp")
83 !3 = !{i32 2, !"Dwarf Version", i32 4}
84 !4 = !{i32 2, !"Debug Info Version", i32 3}
85 !5 = !{i32 1, !"PIC Level", i32 2}
86 !6 = !{!"clang version 4.0.0 (trunk 282540) (llvm/trunk 282542)"}
87 !7 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 1, type: !8, isLocal: false, isDefinition: true, scopeLine: 1, isOptimized: true, unit: !0, retainedNodes: !2)
88 !8 = !DISubroutineType(types: !2)
89 !9 = !DILocation(line: 1, column: 13, scope: !7)
90 !10 = distinct !DISubprogram(name: "bar", scope: !1, file: !1, line: 3, type: !8, isLocal: false, isDefinition: true, scopeLine: 3, isOptimized: true, unit: !0, retainedNodes: !2)
91 !11 = !DILocation(line: 4, column: 10, scope: !10)
92 !12 = !DILocation(line: 4, column: 3, scope: !10)
93 !13 = !{!"function_entry_count", i64 30}