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 \ |
| 8 | ; RUN: -r=%t2.bc,_foo,l |
| 9 | ; RUN: llvm-dis %t.o.1.3.import.bc -o - | FileCheck %s |
Sean Fertile | 4595a91 | 2017-11-04 17:04:39 +0000 | [diff] [blame^] | 10 | ; CHECK: define available_externally dso_local void @foo() |
Teresa Johnson | 002af9b | 2016-10-31 22:12:21 +0000 | [diff] [blame] | 11 | |
| 12 | ; We shouldn't do any importing at -O0 |
| 13 | ; rm -f %t.o.1.3.import.bc |
Peter Collingbourne | 7faa60c | 2017-04-11 18:12:00 +0000 | [diff] [blame] | 14 | ; 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] | 15 | ; RUN: -O0 \ |
| 16 | ; RUN: -r=%t1.bc,_foo,plx \ |
| 17 | ; RUN: -r=%t2.bc,_main,plx \ |
| 18 | ; RUN: -r=%t2.bc,_foo,l |
| 19 | ; RUN: llvm-dis %t.o.1.3.import.bc -o - | FileCheck %s --check-prefix=CHECKO0 |
Sean Fertile | 4595a91 | 2017-11-04 17:04:39 +0000 | [diff] [blame^] | 20 | ; CHECKO0: declare dso_local void @foo(...) |
Teresa Johnson | 002af9b | 2016-10-31 22:12:21 +0000 | [diff] [blame] | 21 | |
| 22 | target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" |
| 23 | target triple = "x86_64-apple-macosx10.11.0" |
| 24 | |
| 25 | define void @foo() #0 { |
| 26 | entry: |
| 27 | ret void |
| 28 | } |