brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · 3c82724 Raw
44 lines · plain
1; Test to check the callgraph in summary2; RUN: opt -write-relbf-to-summary -module-summary %s -o %t.o3; RUN: llvm-bcanalyzer -dump %t.o | FileCheck %s4; RUN: llvm-dis -o - %t.o | FileCheck %s --check-prefix=DIS5; Round trip it through llvm-as6; RUN: llvm-dis -o - %t.o | llvm-as -write-relbf-to-summary -o - | llvm-dis -o - | FileCheck %s --check-prefix=DIS7 8; CHECK: <SOURCE_FILENAME9; CHECK-NEXT: <GLOBALVAR10; CHECK-NEXT: <FUNCTION11; "func"12; CHECK-NEXT: <FUNCTION op0=17 op1=413; CHECK:       <GLOBALVAL_SUMMARY_BLOCK14; CHECK-NEXT:    <VERSION15; CHECK-NEXT:    <FLAGS16; See if the call to func is registered.17; CHECK-NEXT:    <PERMODULE_RELBF {{.*}} op4=1 {{.*}} op9=25618; CHECK-NEXT:  </GLOBALVAL_SUMMARY_BLOCK>19; CHECK: <STRTAB_BLOCK20; CHECK-NEXT: blob data = 'undefinedglobmainfunc{{.*}}'21 22 23; ModuleID = 'thinlto-function-summary-callgraph.ll'24target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"25target triple = "x86_64-unknown-linux-gnu"26 27; Function Attrs: nounwind uwtable28define i32 @main() #0 {29entry:30    call void (...) @func()31    %u = load i32, i32* @undefinedglob32    ret i32 %u33}34 35declare void @func(...) #136@undefinedglob = external global i3237 38; OLD: Index {{.*}} contains 1 nodes (1 functions, 0 alias, 0 globals) and 1 edges (0 refs and 1 calls)39 40; DIS: ^0 = module: (path: "{{.*}}", hash: (0, 0, 0, 0, 0))41; DIS: ^1 = gv: (name: "func") ; guid = 728917527237675942142; DIS: ^2 = gv: (name: "main", summaries: (function: (module: ^0, flags: (linkage: external, visibility: default, notEligibleToImport: 0, live: 0, dsoLocal: 0, canAutoHide: 0, importType: definition), insts: 3, calls: ((callee: ^1, relbf: 256)), refs: (readonly ^3)))) ; guid = 1582266305281194956243; DIS: ^3 = gv: (name: "undefinedglob") ; guid = 1803690180402994940344