1 ; Test to ensure that building summary with -force-summary-edges-cold
2 ; blocks importing as expected.
4 ; "-stats" and "-debug-only" require +Asserts.
7 ; First do with default options, which should import
8 ; RUN: opt -module-summary %s -o %t.bc
9 ; RUN: opt -module-summary %p/Inputs/funcimport_forcecold.ll -o %t2.bc
10 ; RUN: llvm-lto -thinlto -o %t3 %t.bc %t2.bc
11 ; RUN: opt -function-import -stats -print-imports -summary-file %t3.thinlto.bc %t.bc -S 2>&1 | FileCheck %s --check-prefix=IMPORT
13 ; Next rebuild caller module summary with non-critical edges forced cold (which
14 ; should affect all edges in this test as we don't have any sample pgo).
15 ; Make sure we don't import.
16 ; RUN: opt -force-summary-edges-cold=all-non-critical -module-summary %s -o %t.bc
17 ; RUN: llvm-lto -thinlto -o %t3 %t.bc %t2.bc
18 ; RUN: opt -function-import -stats -print-imports -summary-file %t3.thinlto.bc %t.bc -S 2>&1 | FileCheck %s --check-prefix=NOIMPORT
20 ; Next rebuild caller module summary with all edges forced cold.
21 ; Make sure we don't import.
22 ; RUN: opt -force-summary-edges-cold=all -module-summary %s -o %t.bc
23 ; RUN: llvm-lto -thinlto -o %t3 %t.bc %t2.bc
24 ; RUN: opt -function-import -stats -print-imports -summary-file %t3.thinlto.bc %t.bc -S 2>&1 | FileCheck %s --check-prefix=NOIMPORT
33 ; NOIMPORT-NOT: Import foo
34 ; IMPORT: define available_externally void @foo()
35 ; NOIMPORT: declare void @foo()