blob: 73d229583ca0bbf10103e68f61ea06e3e98917c0 [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
Teresa Johnson08d5b4e2018-05-26 02:34:13 +00004; RUN: llvm-dis -o - %t.o | FileCheck %s --check-prefix=DIS
Easwaran Raman6b7209b2018-01-25 22:23:52 +00005
6
7; CHECK: <SOURCE_FILENAME
8; CHECK-NEXT: <GLOBALVAR
9; CHECK-NEXT: <FUNCTION
10; "func"
11; CHECK-NEXT: <FUNCTION op0=17 op1=4
12; CHECK: <GLOBALVAL_SUMMARY_BLOCK
13; CHECK-NEXT: <VERSION
14; See if the call to func is registered.
Easwaran Raman385d8ea2018-02-22 19:44:08 +000015; CHECK-NEXT: <PERMODULE_RELBF {{.*}} op4=1 {{.*}} op7=256
Easwaran Raman6b7209b2018-01-25 22:23:52 +000016; CHECK-NEXT: </GLOBALVAL_SUMMARY_BLOCK>
17; CHECK: <STRTAB_BLOCK
18; CHECK-NEXT: blob data = 'undefinedglobmainfunc{{.*}}'
19
20
21; ModuleID = 'thinlto-function-summary-callgraph.ll'
22target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
23target triple = "x86_64-unknown-linux-gnu"
24
25; Function Attrs: nounwind uwtable
26define i32 @main() #0 {
27entry:
28 call void (...) @func()
29 %u = load i32, i32* @undefinedglob
30 ret i32 %u
31}
32
33declare void @func(...) #1
34@undefinedglob = external global i32
35
36; OLD: Index {{.*}} contains 1 nodes (1 functions, 0 alias, 0 globals) and 1 edges (0 refs and 1 calls)
Teresa Johnson08d5b4e2018-05-26 02:34:13 +000037
Teresa Johnsonfb89e7a2018-05-26 03:50:29 +000038; DIS: ^0 = module: (path: "{{.*}}thinlto-function-summary-callgraph-relbf.ll.tmp.o", hash: (0, 0, 0, 0, 0))
Teresa Johnson08d5b4e2018-05-26 02:34:13 +000039; DIS: ^1 = gv: (name: "func") ; guid = 7289175272376759421
40; 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; DIS: ^3 = gv: (name: "undefinedglob") ; guid = 18036901804029949403