1*6b7209b3SEaswaran Raman; Test to check the callgraph in summary
2*6b7209b3SEaswaran Raman; RUN: opt -write-relbf-to-summary -module-summary %s -o %t.o
3*6b7209b3SEaswaran Raman; RUN: llvm-bcanalyzer -dump %t.o | FileCheck %s
4*6b7209b3SEaswaran Raman
5*6b7209b3SEaswaran Raman
6*6b7209b3SEaswaran Raman; CHECK: <SOURCE_FILENAME
7*6b7209b3SEaswaran Raman; CHECK-NEXT: <GLOBALVAR
8*6b7209b3SEaswaran Raman; CHECK-NEXT: <FUNCTION
9*6b7209b3SEaswaran Raman; "func"
10*6b7209b3SEaswaran Raman; CHECK-NEXT: <FUNCTION op0=17 op1=4
11*6b7209b3SEaswaran Raman; CHECK:       <GLOBALVAL_SUMMARY_BLOCK
12*6b7209b3SEaswaran Raman; CHECK-NEXT:    <VERSION
13*6b7209b3SEaswaran Raman; See if the call to func is registered.
14*6b7209b3SEaswaran Raman; CHECK-NEXT:    <PERMODULE_RELBF {{.*}} op4=1 {{.*}} op7=1
15*6b7209b3SEaswaran Raman; CHECK-NEXT:  </GLOBALVAL_SUMMARY_BLOCK>
16*6b7209b3SEaswaran Raman; CHECK: <STRTAB_BLOCK
17*6b7209b3SEaswaran Raman; CHECK-NEXT: blob data = 'undefinedglobmainfunc{{.*}}'
18*6b7209b3SEaswaran Raman
19*6b7209b3SEaswaran Raman
20*6b7209b3SEaswaran Raman; ModuleID = 'thinlto-function-summary-callgraph.ll'
21*6b7209b3SEaswaran Ramantarget datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
22*6b7209b3SEaswaran Ramantarget triple = "x86_64-unknown-linux-gnu"
23*6b7209b3SEaswaran Raman
24*6b7209b3SEaswaran Raman; Function Attrs: nounwind uwtable
25*6b7209b3SEaswaran Ramandefine i32 @main() #0 {
26*6b7209b3SEaswaran Ramanentry:
27*6b7209b3SEaswaran Raman    call void (...) @func()
28*6b7209b3SEaswaran Raman    %u = load i32, i32* @undefinedglob
29*6b7209b3SEaswaran Raman    ret i32 %u
30*6b7209b3SEaswaran Raman}
31*6b7209b3SEaswaran Raman
32*6b7209b3SEaswaran Ramandeclare void @func(...) #1
33*6b7209b3SEaswaran Raman@undefinedglob = external global i32
34*6b7209b3SEaswaran Raman
35*6b7209b3SEaswaran Raman; OLD: Index {{.*}} contains 1 nodes (1 functions, 0 alias, 0 globals) and 1 edges (0 refs and 1 calls)
36