blob: e8533dbc05534c91cd8ab9f8e500ec208b9e1b56 [file] [log] [blame]
Teresa Johnson76a1c1d2016-03-11 18:52:24 +00001; Test to check the callgraph in summary
Mehdi Amini68da4262016-04-12 21:35:18 +00002; RUN: opt -module-summary %s -o %t.o
Teresa Johnson76a1c1d2016-03-11 18:52:24 +00003; RUN: llvm-bcanalyzer -dump %t.o | FileCheck %s
Mehdi Amini68da4262016-04-12 21:35:18 +00004; RUN: opt -module-summary %p/Inputs/thinlto-function-summary-callgraph.ll -o %t2.o
Teresa Johnson76a1c1d2016-03-11 18:52:24 +00005; RUN: llvm-lto -thinlto -o %t3 %t.o %t2.o
6; RUN: llvm-bcanalyzer -dump %t3.thinlto.bc | FileCheck %s --check-prefix=COMBINED
7
8; CHECK: <GLOBALVAL_SUMMARY_BLOCK
9; See if the call to func is registered, using the expected callsite count
10; and value id matching the subsequent value symbol table.
11; CHECK-NEXT: <PERMODULE {{.*}} op4=[[FUNCID:[0-9]+]] op5=1/>
12; CHECK-NEXT: </GLOBALVAL_SUMMARY_BLOCK>
13; CHECK-NEXT: <VALUE_SYMTAB
14; CHECK-NEXT: <FNENTRY {{.*}} record string = 'main'
15; External function func should have entry with value id FUNCID
16; CHECK-NEXT: <ENTRY {{.*}} op0=[[FUNCID]] {{.*}} record string = 'func'
17; CHECK-NEXT: </VALUE_SYMTAB>
18
19; COMBINED: <GLOBALVAL_SUMMARY_BLOCK
20; COMBINED-NEXT: <COMBINED
21; See if the call to func is registered, using the expected callsite count
22; and value id matching the subsequent value symbol table.
23; COMBINED-NEXT: <COMBINED {{.*}} op4=[[FUNCID:[0-9]+]] op5=1/>
24; COMBINED-NEXT: </GLOBALVAL_SUMMARY_BLOCK>
25; COMBINED-NEXT: <VALUE_SYMTAB
26; Entry for function func should have entry with value id FUNCID
27; COMBINED-NEXT: <COMBINED_GVDEFENTRY {{.*}} op0=[[FUNCID]] {{.*}} op2=7289175272376759421/>
28; COMBINED-NEXT: <COMBINED_GVDEFENTRY
29; COMBINED-NEXT: </VALUE_SYMTAB>
30
31; ModuleID = 'thinlto-function-summary-callgraph.ll'
32target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
33target triple = "x86_64-unknown-linux-gnu"
34
35; Function Attrs: nounwind uwtable
36define i32 @main() #0 {
37entry:
38 call void (...) @func()
39 ret i32 0
40}
41
42declare void @func(...) #1