16b7209b3SEaswaran Raman; Test to check the callgraph in summary 26b7209b3SEaswaran Raman; RUN: opt -write-relbf-to-summary -module-summary %s -o %t.o 36b7209b3SEaswaran Raman; RUN: llvm-bcanalyzer -dump %t.o | FileCheck %s 4*08d5b4efSTeresa Johnson; RUN: llvm-dis -o - %t.o | FileCheck %s --check-prefix=DIS 56b7209b3SEaswaran Raman 66b7209b3SEaswaran Raman 76b7209b3SEaswaran Raman; CHECK: <SOURCE_FILENAME 86b7209b3SEaswaran Raman; CHECK-NEXT: <GLOBALVAR 96b7209b3SEaswaran Raman; CHECK-NEXT: <FUNCTION 106b7209b3SEaswaran Raman; "func" 116b7209b3SEaswaran Raman; CHECK-NEXT: <FUNCTION op0=17 op1=4 126b7209b3SEaswaran Raman; CHECK: <GLOBALVAL_SUMMARY_BLOCK 136b7209b3SEaswaran Raman; CHECK-NEXT: <VERSION 146b7209b3SEaswaran Raman; See if the call to func is registered. 15385d8ea8SEaswaran Raman; CHECK-NEXT: <PERMODULE_RELBF {{.*}} op4=1 {{.*}} op7=256 166b7209b3SEaswaran Raman; CHECK-NEXT: </GLOBALVAL_SUMMARY_BLOCK> 176b7209b3SEaswaran Raman; CHECK: <STRTAB_BLOCK 186b7209b3SEaswaran Raman; CHECK-NEXT: blob data = 'undefinedglobmainfunc{{.*}}' 196b7209b3SEaswaran Raman 206b7209b3SEaswaran Raman 216b7209b3SEaswaran Raman; ModuleID = 'thinlto-function-summary-callgraph.ll' 226b7209b3SEaswaran Ramantarget datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 236b7209b3SEaswaran Ramantarget triple = "x86_64-unknown-linux-gnu" 246b7209b3SEaswaran Raman 256b7209b3SEaswaran Raman; Function Attrs: nounwind uwtable 266b7209b3SEaswaran Ramandefine i32 @main() #0 { 276b7209b3SEaswaran Ramanentry: 286b7209b3SEaswaran Raman call void (...) @func() 296b7209b3SEaswaran Raman %u = load i32, i32* @undefinedglob 306b7209b3SEaswaran Raman ret i32 %u 316b7209b3SEaswaran Raman} 326b7209b3SEaswaran Raman 336b7209b3SEaswaran Ramandeclare void @func(...) #1 346b7209b3SEaswaran Raman@undefinedglob = external global i32 356b7209b3SEaswaran Raman 366b7209b3SEaswaran Raman; OLD: Index {{.*}} contains 1 nodes (1 functions, 0 alias, 0 globals) and 1 edges (0 refs and 1 calls) 37*08d5b4efSTeresa Johnson 38*08d5b4efSTeresa Johnson; DIS: ^0 = module: (path: "{{.*}}/test/Bitcode/Output/thinlto-function-summary-callgraph-relbf.ll.tmp.o", hash: (0, 0, 0, 0, 0)) 39*08d5b4efSTeresa Johnson; DIS: ^1 = gv: (name: "func") ; guid = 7289175272376759421 40*08d5b4efSTeresa Johnson; DIS: ^2 = gv: (name: "main", summaries: (function: (module: ^0, flags: (linkage: external, notEligibleToImport: 0, live: 0, dsoLocal: 0), insts: 3, calls: ((callee: ^1, relbf: 256)), refs: (^3)))) ; guid = 15822663052811949562 41*08d5b4efSTeresa Johnson; DIS: ^3 = gv: (name: "undefinedglob") ; guid = 18036901804029949403 42