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-alias.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 analias should have entry with value id FUNCID 17 ; CHECK-NEXT: <ENTRY {{.*}} op0=[[FUNCID]] {{.*}} record string = 'analias' 18 ; CHECK-NEXT: </VALUE_SYMTAB> 19 20 ; COMBINED: <GLOBALVAL_SUMMARY_BLOCK 21 ; COMBINED-NEXT: <VERSION 22 ; See if the call to analias is registered, using the expected callsite count 23 ; and value id matching the subsequent value symbol table. 24 ; COMBINED-NEXT: <COMBINED {{.*}} op5=[[ALIASID:[0-9]+]] op6=1/> 25 ; Followed by the alias and aliasee 26 ; COMBINED-NEXT: <COMBINED {{.*}} 27 ; COMBINED-NEXT: <COMBINED_ALIAS {{.*}} op3=[[ALIASEEID:[0-9]+]] 28 ; COMBINED-NEXT: </GLOBALVAL_SUMMARY_BLOCK 29 ; COMBINED-NEXT: <VALUE_SYMTAB 30 ; Entry for function func should have entry with value id ALIASID 31 ; COMBINED-NEXT: <COMBINED_ENTRY {{.*}} op0=[[ALIASID]] op1=-5751648690987223394/> 32 ; COMBINED-NEXT: <COMBINED 33 ; COMBINED-NEXT: <COMBINED_ENTRY {{.*}} op0=[[ALIASEEID]] op1=-1039159065113703048/> 34 ; COMBINED-NEXT: </VALUE_SYMTAB> 35 36 ; ModuleID = 'thinlto-function-summary-callgraph.ll' 37 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 38 target triple = "x86_64-unknown-linux-gnu" 39 40 ; Function Attrs: nounwind uwtable 41 define i32 @main() { 42 entry: 43 call void (...) @analias() 44 ret i32 0 45 } 46 47 declare void @analias(...) 48