Teresa Johnson | 002af9b | 2016-10-31 22:12:21 +0000 | [diff] [blame] | 1 | ; Do setup work for all below tests: generate bitcode and combined index |
| 2 | ; RUN: opt -module-summary %s -o %t1.bc |
| 3 | ; RUN: opt -module-summary %p/Inputs/funcimport2.ll -o %t2.bc |
| 4 | |
Peter Collingbourne | 7faa60c | 2017-04-11 18:12:00 +0000 | [diff] [blame] | 5 | ; RUN: llvm-lto2 run %t1.bc %t2.bc -o %t.o -save-temps \ |
Teresa Johnson | 002af9b | 2016-10-31 22:12:21 +0000 | [diff] [blame] | 6 | ; RUN: -r=%t1.bc,_foo,plx \ |
| 7 | ; RUN: -r=%t2.bc,_main,plx \ |
Teresa Johnson | cb9a82f | 2018-08-17 16:53:47 +0000 | [diff] [blame] | 8 | ; RUN: -r=%t2.bc,_foo,l \ |
| 9 | ; RUN: -print-import-failures 2>&1 | FileCheck %s --check-prefix=NOFAILURES |
Vitaly Buka | a5376f3 | 2017-12-16 02:10:00 +0000 | [diff] [blame] | 10 | ; RUN: llvm-dis %t.o.2.3.import.bc -o - | FileCheck %s |
Sean Fertile | 4595a91 | 2017-11-04 17:04:39 +0000 | [diff] [blame] | 11 | ; CHECK: define available_externally dso_local void @foo() |
Teresa Johnson | cb9a82f | 2018-08-17 16:53:47 +0000 | [diff] [blame] | 12 | ; Don't expect any failure messages from -print-import-failures |
| 13 | ; NOFAILURES-NOT: Reason = |
| 14 | |
| 15 | ; We shouldn't do any importing with a 0 instruction limit, in which case |
| 16 | ; -print-import-failures should print a TooLarge reason. |
| 17 | ; RUN: llvm-lto2 run %t1.bc %t2.bc -o %t.o -save-temps \ |
| 18 | ; RUN: -r=%t1.bc,_foo,plx \ |
| 19 | ; RUN: -r=%t2.bc,_main,plx \ |
| 20 | ; RUN: -r=%t2.bc,_foo,l \ |
| 21 | ; RUN: -import-instr-limit=0 \ |
| 22 | ; RUN: -print-import-failures 2>&1 | FileCheck %s --check-prefix=FAILURES |
| 23 | ; RUN: llvm-dis %t.o.2.3.import.bc -o - | FileCheck %s --check-prefix=NOIMPORT |
| 24 | ; FAILURES: (foo): Reason = TooLarge, Threshold = 0, Size = 1, MaxHotness = unknown, Attempts = 1 |
Teresa Johnson | 002af9b | 2016-10-31 22:12:21 +0000 | [diff] [blame] | 25 | |
| 26 | ; We shouldn't do any importing at -O0 |
| 27 | ; rm -f %t.o.1.3.import.bc |
Peter Collingbourne | 7faa60c | 2017-04-11 18:12:00 +0000 | [diff] [blame] | 28 | ; RUN: llvm-lto2 run %t1.bc %t2.bc -o %t.o -save-temps \ |
Teresa Johnson | 002af9b | 2016-10-31 22:12:21 +0000 | [diff] [blame] | 29 | ; RUN: -O0 \ |
| 30 | ; RUN: -r=%t1.bc,_foo,plx \ |
| 31 | ; RUN: -r=%t2.bc,_main,plx \ |
| 32 | ; RUN: -r=%t2.bc,_foo,l |
Teresa Johnson | cb9a82f | 2018-08-17 16:53:47 +0000 | [diff] [blame] | 33 | ; RUN: llvm-dis %t.o.2.3.import.bc -o - | FileCheck %s --check-prefix=NOIMPORT |
| 34 | ; NOIMPORT: declare dso_local void @foo(...) |
Teresa Johnson | 002af9b | 2016-10-31 22:12:21 +0000 | [diff] [blame] | 35 | |
| 36 | target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" |
| 37 | target triple = "x86_64-apple-macosx10.11.0" |
| 38 | |
| 39 | define void @foo() #0 { |
| 40 | entry: |
| 41 | ret void |
| 42 | } |