1; Test to ensure that building summary with -force-summary-edges-cold 2; blocks importing as expected. 3 4; "-stats" and "-debug-only" require +Asserts. 5; REQUIRES: asserts 6 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 -passes=function-import -stats -print-imports -summary-file %t3.thinlto.bc %t.bc -S 2>&1 | FileCheck %s --check-prefix=IMPORT 12 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 -passes=function-import -stats -print-imports -summary-file %t3.thinlto.bc %t.bc -S 2>&1 | FileCheck %s --check-prefix=NOIMPORT 19 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 -passes=function-import -stats -print-imports -summary-file %t3.thinlto.bc %t.bc -S 2>&1 | FileCheck %s --check-prefix=NOIMPORT 25 26define i32 @main() { 27entry: 28 call void @foo() 29 ret i32 0 30} 31 32; IMPORT: Import foo 33; NOIMPORT-NOT: Import foo 34; IMPORT: define available_externally void @foo() 35; NOIMPORT: declare void @foo() 36declare void @foo() 37