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 only non-critical edges forced cold,
14 ; which should still import in this case.
15 ; RUN: opt -force-summary-edges-cold=all-non-critical -module-summary %s -o %t.bc
16 ; RUN: llvm-lto -thinlto -o %t3 %t.bc %t2.bc
17 ; RUN: opt -function-import -stats -print-imports -summary-file %t3.thinlto.bc %t.bc -S 2>&1 | FileCheck %s --check-prefix=IMPORT
19 ; Next rebuild caller module summary with all edges forced cold.
20 ; Make sure we don't import.
21 ; RUN: opt -force-summary-edges-cold=all -module-summary %s -o %t.bc
22 ; RUN: llvm-lto -thinlto -o %t3 %t.bc %t2.bc
23 ; RUN: opt -function-import -stats -print-imports -summary-file %t3.thinlto.bc %t.bc -S 2>&1 | FileCheck %s --check-prefix=NOIMPORT
25 define i32 @main() !prof !1 {
32 ; NOIMPORT-NOT: Import foo
33 ; IMPORT: define available_externally void @foo()
34 ; NOIMPORT: declare void @foo()
37 !1 = !{!"function_entry_count", i64 110, i64 6699318081062747564}