1 ; Test to ensure that thin linking with -import-cutoff stops importing when
4 ; "-stats" and "-debug-only" require +Asserts.
7 ; RUN: opt -module-summary %s -o %t.bc
8 ; RUN: opt -module-summary %p/Inputs/funcimport_cutoff.ll -o %t2.bc
9 ; RUN: llvm-lto -thinlto -o %t3 %t.bc %t2.bc
11 ; First do with default options, which should import both foo and bar
12 ; RUN: opt -function-import -stats -print-imports -summary-file %t3.thinlto.bc %t.bc -S 2>&1 | FileCheck %s --check-prefix=IMPORT
14 ; Next try to restrict to 1 import. This should import just foo.
15 ; RUN: opt -import-cutoff=1 -function-import -stats -print-imports -summary-file %t3.thinlto.bc %t.bc -S 2>&1 | FileCheck %s --check-prefix=IMPORT1
17 ; Next try to restrict to 0 imports. This should not import.
18 ; RUN: opt -import-cutoff=0 -function-import -stats -print-imports -summary-file %t3.thinlto.bc %t.bc -S 2>&1 | FileCheck %s --check-prefix=NOIMPORT
30 ; Check -print-imports output
34 ; IMPORT1-NOT: Import bar
35 ; NOIMPORT-NOT: Import foo
36 ; NOIMPORT-NOT: Import bar
39 ; IMPORT-DAG: define available_externally void @foo()
40 ; IMPORT-DAG: define available_externally void @bar()
41 ; NOIMPORT-DAG: declare void @foo()
42 ; NOIMPORT-DAG: declare void @bar()
43 ; IMPORT1-DAG: define available_externally void @foo()
44 ; IMPORT1-DAG: declare void @bar()
47 ; IMPORT: 2 function-import - Number of functions imported
48 ; IMPORT1: 1 function-import - Number of functions imported
49 ; NOIMPORT-NOT: function-import - Number of functions imported