1 ; RUN: opt -module-summary %s -o %t1.bc
2 ; RUN: opt -module-summary %p/Inputs/diagnostic-handler-remarks.ll -o %t2.bc
4 ; Optimization records are collected regardless of the diagnostic handler
5 ; RUN: rm -f %t.yaml.thin.0.yaml %t.yaml.thin.1.yaml
6 ; RUN: llvm-lto -thinlto-action=run \
7 ; RUN: -use-new-pm=false \
8 ; RUN: -lto-pass-remarks-output=%t.yaml \
9 ; RUN: -lto-pass-remarks-filter=inline \
10 ; RUN: -lto-pass-remarks-format=yaml \
11 ; RUN: -exported-symbol _func2 \
12 ; RUN: -exported-symbol _main %t1.bc %t2.bc 2>&1 | \
13 ; RUN: FileCheck %s -allow-empty
15 ; CHECK-NOT: llvm-lto:
18 ; Verify that bar is imported 'and' inlined into 'foo'
19 ; RUN: cat %t.yaml.thin.0.yaml | FileCheck %s -check-prefix=YAML1
21 ; YAML1-NEXT: Pass: inline
22 ; YAML1-NEXT: Name: Inlined
23 ; YAML1-NEXT: Function: main
25 ; YAML1-NEXT: - String: ''''
26 ; YAML1-NEXT: - Callee: foo
27 ; YAML1-NEXT: - String: ''' inlined into '
28 ; YAML1-NEXT: - Caller: main
29 ; YAML1-NEXT: - String: ''''
30 ; YAML1-NEXT: - String: ' with '
31 ; YAML1-NEXT: - String: '(cost='
32 ; YAML1-NEXT: - Cost: '-30'
33 ; YAML1-NEXT: - String: ', threshold='
34 ; YAML1-NEXT: - Threshold: '337'
35 ; YAML1-NEXT: - String: ')'
39 ; Verify that bar is imported 'and' inlined into 'foo'
40 ; RUN: cat %t.yaml.thin.1.yaml | FileCheck %s -check-prefix=YAML2
42 ; YAML2-NEXT: Pass: inline
43 ; YAML2-NEXT: Name: Inlined
44 ; YAML2-NEXT: Function: foo
46 ; YAML2-NEXT: - String: ''''
47 ; YAML2-NEXT: - Callee: bar
48 ; YAML2-NEXT: - String: ''' inlined into '
49 ; YAML2-NEXT: - Caller: foo
50 ; YAML2-NEXT: - String: ''''
51 ; YAML2-NEXT: - String: ' with '
52 ; YAML2-NEXT: - String: '(cost='
53 ; YAML2-NEXT: - Cost: '-30'
54 ; YAML2-NEXT: - String: ', threshold='
55 ; YAML2-NEXT: - Threshold: '337'
56 ; YAML2-NEXT: - String: ')'
59 ; The file extension depends on the format of the remarks
60 ; RUN: rm -f %t.bitstream.thin.0.bitstream %t.bitstream.thin.1.bitstream
61 ; RUN: llvm-lto -thinlto-action=run \
62 ; RUN: -lto-pass-remarks-output=%t.bitstream \
63 ; RUN: -lto-pass-remarks-filter=inline \
64 ; RUN: -lto-pass-remarks-format=bitstream \
65 ; RUN: -exported-symbol _func2 \
66 ; RUN: -exported-symbol _main %t1.bc %t2.bc 2>&1 | \
67 ; RUN: FileCheck %s -allow-empty
68 ; RUN: llvm-bcanalyzer %t.bitstream.thin.0.bitstream
69 ; RUN: llvm-bcanalyzer %t.bitstream.thin.1.bitstream
71 ; CHECK-NOT: llvm-lto:
73 target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
74 target triple = "x86_64-apple-macosx10.11.0"