1; 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: <SOURCE_FILENAME
9; "main"
10; CHECK-NEXT: <FUNCTION op0=0 op1=4
11; "analias"
12; CHECK-NEXT: <FUNCTION op0=4 op1=7
13; CHECK:       <GLOBALVAL_SUMMARY_BLOCK
14; CHECK-NEXT:    <VERSION
15; See if the call to func is registered.
16; The value id 1 matches the second FUNCTION record above.
17; CHECK-NEXT:    <PERMODULE {{.*}} op4=1/>
18; CHECK-NEXT:  </GLOBALVAL_SUMMARY_BLOCK>
19
20; CHECK: <STRTAB_BLOCK
21; CHECK-NEXT: blob data = 'mainanalias'
22
23; COMBINED:       <GLOBALVAL_SUMMARY_BLOCK
24; COMBINED-NEXT:    <VERSION
25; See if the call to analias is registered, using the expected value id.
26; COMBINED-NEXT:    <VALUE_GUID op0=[[ALIASID:[0-9]+]] op1=-5751648690987223394/>
27; COMBINED-NEXT:    <VALUE_GUID
28; COMBINED-NEXT:    <VALUE_GUID op0=[[ALIASEEID:[0-9]+]] op1=-1039159065113703048/>
29; COMBINED-NEXT:    <COMBINED {{.*}} op5=[[ALIASID]]/>
30; COMBINED-NEXT:    <COMBINED {{.*}}
31; COMBINED-NEXT:    <COMBINED_ALIAS  {{.*}} op3=[[ALIASEEID]]
32; COMBINED-NEXT:  </GLOBALVAL_SUMMARY_BLOCK
33
34; ModuleID = 'thinlto-function-summary-callgraph.ll'
35target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
36target triple = "x86_64-unknown-linux-gnu"
37
38; Function Attrs: nounwind uwtable
39define i32 @main() {
40entry:
41    call void (...) @analias()
42    ret i32 0
43}
44
45declare void @analias(...)
46