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