1; RUN: opt -module-summary %s -o %t1.bc 2; RUN: opt -module-summary %p/Inputs/diagnostic-handler-remarks.ll -o %t2.bc 3 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: -lto-pass-remarks-output=%t.yaml \ 8; RUN: -exported-symbol _func2 \ 9; RUN: -exported-symbol _main %t1.bc %t2.bc 2>&1 | \ 10; RUN: FileCheck %s -allow-empty 11; CHECK-NOT: remark: 12; CHECK-NOT: llvm-lto: 13 14 15; Verify that bar is imported and inlined into foo 16; RUN: cat %t.yaml.thin.0.yaml | FileCheck %s -check-prefix=YAML1 17; YAML1: --- !Passed 18; YAML1-NEXT: Pass: inline 19; YAML1-NEXT: Name: Inlined 20; YAML1-NEXT: Function: main 21; YAML1-NEXT: Args: 22; YAML1-NEXT: - Callee: foo 23; YAML1-NEXT: - String: ' inlined into ' 24; YAML1-NEXT: - Caller: main 25; YAML1-NEXT: - String: ' with cost=' 26; YAML1-NEXT: - Cost: '-30' 27; YAML1-NEXT: - String: ' (threshold=' 28; YAML1-NEXT: - Threshold: '337' 29; YAML1-NEXT: - String: ')' 30; YAML1-NEXT: ... 31 32 33; Verify that bar is imported and inlined into foo 34; RUN: cat %t.yaml.thin.1.yaml | FileCheck %s -check-prefix=YAML2 35; YAML2: --- !Passed 36; YAML2-NEXT: Pass: inline 37; YAML2-NEXT: Name: Inlined 38; YAML2-NEXT: Function: foo 39; YAML2-NEXT: Args: 40; YAML2-NEXT: - Callee: bar 41; YAML2-NEXT: - String: ' inlined into ' 42; YAML2-NEXT: - Caller: foo 43; YAML2-NEXT: - String: ' with cost=' 44; YAML2-NEXT: - Cost: '-30' 45; YAML2-NEXT: - String: ' (threshold=' 46; YAML2-NEXT: - Threshold: '337' 47; YAML2-NEXT: - String: ')' 48; YAML2-NEXT: ... 49 50 51target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" 52target triple = "x86_64-apple-macosx10.11.0" 53 54define i32 @bar() { 55 ret i32 42 56} 57declare i32 @foo() 58define i32 @main() { 59 %i = call i32 @foo() 60 ret i32 %i 61} 62 63