blob: 58411ca65237700d101371b92bd4ae37215c8257 [file] [log] [blame]
Mehdi Amini2d28f7a2016-04-16 06:56:44 +00001; Test to check the callgraph in summary
2; RUN: opt -module-summary %s -o %t.o
3; RUN: llvm-bcanalyzer -dump %t.o | FileCheck %s
4; RUN: opt -module-summary %p/Inputs/thinlto-alias.ll -o %t2.o
5; 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
Mehdi Amini8fe69362016-04-24 03:18:11 +00009; CHECK-NEXT: <VERSION
Mehdi Amini2d28f7a2016-04-16 06:56:44 +000010; See if the call to func is registered, using the expected callsite count
11; and value id matching the subsequent value symbol table.
12; CHECK-NEXT: <PERMODULE {{.*}} op4=[[FUNCID:[0-9]+]] op5=1/>
13; CHECK-NEXT: </GLOBALVAL_SUMMARY_BLOCK>
14; CHECK-NEXT: <VALUE_SYMTAB
15; CHECK-NEXT: <FNENTRY {{.*}} record string = 'main'
16; External function analias should have entry with value id FUNCID
17; CHECK-NEXT: <ENTRY {{.*}} op0=[[FUNCID]] {{.*}} record string = 'analias'
18; CHECK-NEXT: </VALUE_SYMTAB>
19
20; COMBINED: <GLOBALVAL_SUMMARY_BLOCK
Mehdi Amini8fe69362016-04-24 03:18:11 +000021; COMBINED-NEXT: <VERSION
Mehdi Amini2d28f7a2016-04-16 06:56:44 +000022; See if the call to analias is registered, using the expected callsite count
23; and value id matching the subsequent value symbol table.
Teresa Johnson02e98332016-04-27 13:28:35 +000024; COMBINED-NEXT: <COMBINED {{.*}} op5=[[ALIASID:[0-9]+]] op6=1/>
Mehdi Amini2d28f7a2016-04-16 06:56:44 +000025; Followed by the alias and aliasee
26; COMBINED-NEXT: <COMBINED {{.*}}
Teresa Johnson02e98332016-04-27 13:28:35 +000027; COMBINED-NEXT: <COMBINED_ALIAS {{.*}} op3=[[ALIASEEID:[0-9]+]]
Mehdi Amini2d28f7a2016-04-16 06:56:44 +000028; COMBINED-NEXT: </GLOBALVAL_SUMMARY_BLOCK
29; COMBINED-NEXT: <VALUE_SYMTAB
30; Entry for function func should have entry with value id ALIASID
Teresa Johnson02e98332016-04-27 13:28:35 +000031; COMBINED-NEXT: <COMBINED_ENTRY {{.*}} op0=[[ALIASID]] op1=-5751648690987223394/>
32; COMBINED-NEXT: <COMBINED
33; COMBINED-NEXT: <COMBINED_ENTRY {{.*}} op0=[[ALIASEEID]] op1=-1039159065113703048/>
Mehdi Amini2d28f7a2016-04-16 06:56:44 +000034; COMBINED-NEXT: </VALUE_SYMTAB>
35
36; ModuleID = 'thinlto-function-summary-callgraph.ll'
37target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
38target triple = "x86_64-unknown-linux-gnu"
39
40; Function Attrs: nounwind uwtable
41define i32 @main() {
42entry:
43 call void (...) @analias()
44 ret i32 0
45}
46
47declare void @analias(...)