xref: /llvm-project/llvm/test/ThinLTO/X86/funcimport-stats.ll (revision af784a5c13328aa4a8ce622260563b459856a8d4)
1; REQUIRES: asserts
2; RUN: opt -module-summary %p/funcimport.ll -o %t.bc
3; RUN: opt -module-summary %p/Inputs/funcimport.ll -o %t2.bc
4; RUN: llvm-lto -thinlto-action=thinlink -o %t3.bc %t.bc %t2.bc
5
6; RUN: llvm-lto -thinlto-action=import %t2.bc -thinlto-index=%t3.bc -o /dev/null -debug-only=function-import -stats > %t4 2>&1
7; RUN: cat %t4 | grep 'Is importing global' | count 4
8; RUN: cat %t4 | grep 'Is importing function' | count 8
9; RUN: cat %t4 | grep 'Is importing aliasee' | count 1
10; RUN: cat %t4 | FileCheck %s
11
12; CHECK:      - [[NUM_FUNCS:[0-9]+]] function definitions and 0 function declarations imported from
13; CHECK-NEXT: - [[NUM_VARS:[0-9]+]] global vars imported from
14
15; CHECK:      [[NUM_FUNCS]] function-import - Number of functions imported in backend
16; CHECK-NEXT: [[NUM_FUNCS]] function-import - Number of functions thin link decided to import
17; CHECK-NEXT: [[NUM_VARS]] function-import - Number of global variables imported in backend
18; CHECK-NEXT: [[NUM_VARS]] function-import - Number of global variables thin link decided to import
19; CHECK-NEXT: 1 function-import - Number of modules imported from
20; CHECK-NEXT: [[NUM_VARS]] module-summary-index - Number of live global variables marked read only
21; CHECK-NEXT: 1 module-summary-index - Number of live global variables marked write only
22