Teresa Johnson | 76a1c1d | 2016-03-11 18:52:24 +0000 | [diff] [blame] | 1 | ; Test to check the callgraph in summary |
Mehdi Amini | 68da426 | 2016-04-12 21:35:18 +0000 | [diff] [blame^] | 2 | ; RUN: opt -module-summary %s -o %t.o |
Teresa Johnson | 76a1c1d | 2016-03-11 18:52:24 +0000 | [diff] [blame] | 3 | ; RUN: llvm-bcanalyzer -dump %t.o | FileCheck %s |
Mehdi Amini | 68da426 | 2016-04-12 21:35:18 +0000 | [diff] [blame^] | 4 | ; RUN: opt -module-summary %p/Inputs/thinlto-function-summary-callgraph.ll -o %t2.o |
Teresa Johnson | 76a1c1d | 2016-03-11 18:52:24 +0000 | [diff] [blame] | 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 |
| 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' |
| 32 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" |
| 33 | target triple = "x86_64-unknown-linux-gnu" |
| 34 | |
| 35 | ; Function Attrs: nounwind uwtable |
| 36 | define i32 @main() #0 { |
| 37 | entry: |
| 38 | call void (...) @func() |
| 39 | ret i32 0 |
| 40 | } |
| 41 | |
| 42 | declare void @func(...) #1 |