1; Test to check the callgraph in summary 2; RUN: opt -module-summary %s -o %t.o 3; RUN: llvm-bcanalyzer -dump %t.o | FileCheck %s 4; RUN: opt -module-summary %p/Inputs/thinlto-function-summary-callgraph.ll -o %t2.o 5; RUN: llvm-lto -thinlto -o %t3 %t.o %t2.o 6; RUN: llvm-bcanalyzer -dump %t3.thinlto.bc | FileCheck %s --check-prefix=COMBINED 7 8; CHECK: <GLOBALVAL_SUMMARY_BLOCK 9; CHECK-NEXT: <VERSION 10; See if the call to func is registered, using the expected callsite count 11; and value id matching the subsequent value symbol table. 12; CHECK-NEXT: <PERMODULE {{.*}} op4=[[FUNCID:[0-9]+]] op5=1/> 13; CHECK-NEXT: </GLOBALVAL_SUMMARY_BLOCK> 14; CHECK-NEXT: <VALUE_SYMTAB 15; CHECK-NEXT: <FNENTRY {{.*}} record string = 'main' 16; External function func should have entry with value id FUNCID 17; CHECK-NEXT: <ENTRY {{.*}} op0=[[FUNCID]] {{.*}} record string = 'func' 18; CHECK-NEXT: </VALUE_SYMTAB> 19 20; COMBINED: <GLOBALVAL_SUMMARY_BLOCK 21; COMBINED-NEXT: <VERSION 22; COMBINED-NEXT: <COMBINED 23; See if the call to func is registered, using the expected callsite count 24; and value id matching the subsequent value symbol table. 25; COMBINED-NEXT: <COMBINED {{.*}} op5=[[FUNCID:[0-9]+]] op6=1/> 26; COMBINED-NEXT: </GLOBALVAL_SUMMARY_BLOCK> 27; COMBINED-NEXT: <VALUE_SYMTAB 28; Entry for function func should have entry with value id FUNCID 29; COMBINED-NEXT: <COMBINED_ENTRY {{.*}} op0=[[FUNCID]] op1=7289175272376759421/> 30; COMBINED-NEXT: <COMBINED 31; COMBINED-NEXT: </VALUE_SYMTAB> 32 33; ModuleID = 'thinlto-function-summary-callgraph.ll' 34target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 35target triple = "x86_64-unknown-linux-gnu" 36 37; Function Attrs: nounwind uwtable 38define i32 @main() #0 { 39entry: 40 call void (...) @func() 41 ret i32 0 42} 43 44declare void @func(...) #1 45