summaryrefslogtreecommitdiff
path: root/test/Bitcode/thinlto-function-summary-callgraph-relbf.ll
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2018-07-28 10:51:19 +0000
committerDimitry Andric <dim@FreeBSD.org>2018-07-28 10:51:19 +0000
commiteb11fae6d08f479c0799db45860a98af528fa6e7 (patch)
tree44d492a50c8c1a7eb8e2d17ea3360ec4d066f042 /test/Bitcode/thinlto-function-summary-callgraph-relbf.ll
parentb8a2042aa938069e862750553db0e4d82d25822c (diff)
Notes
Diffstat (limited to 'test/Bitcode/thinlto-function-summary-callgraph-relbf.ll')
-rw-r--r--test/Bitcode/thinlto-function-summary-callgraph-relbf.ll42
1 files changed, 42 insertions, 0 deletions
diff --git a/test/Bitcode/thinlto-function-summary-callgraph-relbf.ll b/test/Bitcode/thinlto-function-summary-callgraph-relbf.ll
new file mode 100644
index 000000000000..d84517865a8c
--- /dev/null
+++ b/test/Bitcode/thinlto-function-summary-callgraph-relbf.ll
@@ -0,0 +1,42 @@
+; Test to check the callgraph in summary
+; RUN: opt -write-relbf-to-summary -module-summary %s -o %t.o
+; RUN: llvm-bcanalyzer -dump %t.o | FileCheck %s
+; RUN: llvm-dis -o - %t.o | FileCheck %s --check-prefix=DIS
+; Round trip it through llvm-as
+; RUN: llvm-dis -o - %t.o | llvm-as -write-relbf-to-summary -o - | llvm-dis -o - | FileCheck %s --check-prefix=DIS
+
+; CHECK: <SOURCE_FILENAME
+; CHECK-NEXT: <GLOBALVAR
+; CHECK-NEXT: <FUNCTION
+; "func"
+; CHECK-NEXT: <FUNCTION op0=17 op1=4
+; CHECK: <GLOBALVAL_SUMMARY_BLOCK
+; CHECK-NEXT: <VERSION
+; See if the call to func is registered.
+; CHECK-NEXT: <PERMODULE_RELBF {{.*}} op4=1 {{.*}} op7=256
+; CHECK-NEXT: </GLOBALVAL_SUMMARY_BLOCK>
+; CHECK: <STRTAB_BLOCK
+; CHECK-NEXT: blob data = 'undefinedglobmainfunc{{.*}}'
+
+
+; ModuleID = 'thinlto-function-summary-callgraph.ll'
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
+
+; Function Attrs: nounwind uwtable
+define i32 @main() #0 {
+entry:
+ call void (...) @func()
+ %u = load i32, i32* @undefinedglob
+ ret i32 %u
+}
+
+declare void @func(...) #1
+@undefinedglob = external global i32
+
+; OLD: Index {{.*}} contains 1 nodes (1 functions, 0 alias, 0 globals) and 1 edges (0 refs and 1 calls)
+
+; DIS: ^0 = module: (path: "{{.*}}", hash: (0, 0, 0, 0, 0))
+; DIS: ^1 = gv: (name: "func") ; guid = 7289175272376759421
+; 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
+; DIS: ^3 = gv: (name: "undefinedglob") ; guid = 18036901804029949403