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-dis -o - %t2.o | FileCheck %s --check-prefix=DIS 6; Round trip it through llvm-as 7; RUN: llvm-dis -o - %t2.o | llvm-as -o - | llvm-dis -o - | FileCheck %s --check-prefix=DIS 8; RUN: llvm-lto -thinlto -o %t3 %t.o %t2.o 9; RUN: llvm-bcanalyzer -dump %t3.thinlto.bc | FileCheck %s --check-prefix=COMBINED 10; RUN: llvm-dis -o - %t3.thinlto.bc | FileCheck %s --check-prefix=COMBINED-DIS 11; Round trip it through llvm-as 12; RUN: llvm-dis -o - %t3.thinlto.bc | llvm-as -o - | llvm-dis -o - | FileCheck %s --check-prefix=COMBINED-DIS 13 14; CHECK: <SOURCE_FILENAME 15; "main" 16; CHECK-NEXT: <FUNCTION op0=0 op1=4 17; "analias" 18; CHECK-NEXT: <FUNCTION op0=4 op1=7 19; CHECK: <GLOBALVAL_SUMMARY_BLOCK 20; CHECK-NEXT: <VERSION 21; CHECK-NEXT: <FLAGS 22; See if the call to func is registered. 23; The value id 1 matches the second FUNCTION record above. 24; CHECK-NEXT: <PERMODULE {{.*}} op7=1/> 25; CHECK-NEXT: <BLOCK_COUNT op0=1/> 26; CHECK-NEXT: </GLOBALVAL_SUMMARY_BLOCK> 27 28; CHECK: <STRTAB_BLOCK 29; CHECK-NEXT: blob data = 'mainanalias{{.*}}' 30 31; COMBINED: <GLOBALVAL_SUMMARY_BLOCK 32; COMBINED-NEXT: <VERSION 33; COMBINED-NEXT: <FLAGS 34; See if the call to analias is registered, using the expected value id. 35; COMBINED-NEXT: <VALUE_GUID op0=[[ALIASID:[0-9]+]] op1=-5751648690987223394/> 36; COMBINED-NEXT: <VALUE_GUID 37; COMBINED-NEXT: <VALUE_GUID op0=[[ALIASEEID:[0-9]+]] op1=-1039159065113703048/> 38; COMBINED-NEXT: <COMBINED {{.*}} op9=[[ALIASID]]/> 39; COMBINED-NEXT: <COMBINED {{.*}} 40; COMBINED-NEXT: <COMBINED_ALIAS {{.*}} op3=[[ALIASEEID]] 41; COMBINED-NEXT: <BLOCK_COUNT op0=2/> 42; COMBINED-NEXT: </GLOBALVAL_SUMMARY_BLOCK 43 44; ModuleID = 'thinlto-function-summary-callgraph.ll' 45target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 46target triple = "x86_64-unknown-linux-gnu" 47 48; Function Attrs: nounwind uwtable 49define i32 @main() { 50entry: 51 call void (...) @analias() 52 ret i32 0 53} 54 55declare void @analias(...) 56 57; DIS: ^0 = module: (path: "{{.*}}", hash: (0, 0, 0, 0, 0)) 58; DIS: ^1 = gv: (name: "analias", summaries: (alias: (module: ^0, flags: (linkage: external, visibility: default, notEligibleToImport: 0, live: 0, dsoLocal: 0, canAutoHide: 0), aliasee: ^2))) ; guid = 12695095382722328222 59; DIS: ^2 = gv: (name: "aliasee", summaries: (function: (module: ^0, flags: (linkage: external, visibility: default, notEligibleToImport: 0, live: 0, dsoLocal: 0, canAutoHide: 0), insts: 1))) ; guid = 17407585008595848568 60; DIS: ^3 = blockcount: 1 61 62; COMBINED-DIS: ^0 = module: (path: "{{.*}}thinlto-alias.ll.tmp.o", hash: (0, 0, 0, 0, 0)) 63; COMBINED-DIS: ^1 = module: (path: "{{.*}}thinlto-alias.ll.tmp2.o", hash: (0, 0, 0, 0, 0)) 64; COMBINED-DIS: ^2 = gv: (guid: 12695095382722328222, summaries: (alias: (module: ^1, flags: (linkage: external, visibility: default, notEligibleToImport: 0, live: 0, dsoLocal: 0, canAutoHide: 0), aliasee: ^4))) 65; COMBINED-DIS: ^3 = gv: (guid: 15822663052811949562, summaries: (function: (module: ^0, flags: (linkage: external, visibility: default, notEligibleToImport: 0, live: 0, dsoLocal: 0, canAutoHide: 0), insts: 2, calls: ((callee: ^2))))) 66; COMBINED-DIS: ^4 = gv: (guid: 17407585008595848568, summaries: (function: (module: ^1, flags: (linkage: external, visibility: default, notEligibleToImport: 0, live: 0, dsoLocal: 0, canAutoHide: 0), insts: 1))) 67; COMBINED-DIS: ^5 = blockcount: 2 68