Mehdi Amini | 2d28f7a | 2016-04-16 06:56:44 +0000 | [diff] [blame] | 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 | |
Peter Collingbourne | a0f371a | 2017-04-17 17:51:36 +0000 | [diff] [blame] | 8 | ; CHECK: <SOURCE_FILENAME |
| 9 | ; "main" |
| 10 | ; CHECK-NEXT: <FUNCTION op0=0 op1=4 |
| 11 | ; "analias" |
| 12 | ; CHECK-NEXT: <FUNCTION op0=4 op1=7 |
Mehdi Amini | 2d28f7a | 2016-04-16 06:56:44 +0000 | [diff] [blame] | 13 | ; CHECK: <GLOBALVAL_SUMMARY_BLOCK |
Mehdi Amini | 8fe6936 | 2016-04-24 03:18:11 +0000 | [diff] [blame] | 14 | ; CHECK-NEXT: <VERSION |
Peter Collingbourne | a0f371a | 2017-04-17 17:51:36 +0000 | [diff] [blame] | 15 | ; See if the call to func is registered. |
| 16 | ; The value id 1 matches the second FUNCTION record above. |
Charles Saternos | 75da10d | 2017-08-04 16:00:58 +0000 | [diff] [blame] | 17 | ; CHECK-NEXT: <PERMODULE {{.*}} op5=1/> |
Mehdi Amini | 2d28f7a | 2016-04-16 06:56:44 +0000 | [diff] [blame] | 18 | ; CHECK-NEXT: </GLOBALVAL_SUMMARY_BLOCK> |
Peter Collingbourne | a0f371a | 2017-04-17 17:51:36 +0000 | [diff] [blame] | 19 | |
| 20 | ; CHECK: <STRTAB_BLOCK |
Peter Collingbourne | 92648c2 | 2017-06-27 23:50:11 +0000 | [diff] [blame] | 21 | ; CHECK-NEXT: blob data = 'mainanalias{{.*}}' |
Mehdi Amini | 2d28f7a | 2016-04-16 06:56:44 +0000 | [diff] [blame] | 22 | |
| 23 | ; COMBINED: <GLOBALVAL_SUMMARY_BLOCK |
Mehdi Amini | 8fe6936 | 2016-04-24 03:18:11 +0000 | [diff] [blame] | 24 | ; COMBINED-NEXT: <VERSION |
Teresa Johnson | f368101 | 2018-02-07 04:05:59 +0000 | [diff] [blame] | 25 | ; COMBINED-NEXT: <FLAGS |
Peter Collingbourne | a0f371a | 2017-04-17 17:51:36 +0000 | [diff] [blame] | 26 | ; See if the call to analias is registered, using the expected value id. |
| 27 | ; COMBINED-NEXT: <VALUE_GUID op0=[[ALIASID:[0-9]+]] op1=-5751648690987223394/> |
| 28 | ; COMBINED-NEXT: <VALUE_GUID |
| 29 | ; COMBINED-NEXT: <VALUE_GUID op0=[[ALIASEEID:[0-9]+]] op1=-1039159065113703048/> |
Charles Saternos | 75da10d | 2017-08-04 16:00:58 +0000 | [diff] [blame] | 30 | ; COMBINED-NEXT: <COMBINED {{.*}} op6=[[ALIASID]]/> |
Mehdi Amini | 2d28f7a | 2016-04-16 06:56:44 +0000 | [diff] [blame] | 31 | ; COMBINED-NEXT: <COMBINED {{.*}} |
Peter Collingbourne | a0f371a | 2017-04-17 17:51:36 +0000 | [diff] [blame] | 32 | ; COMBINED-NEXT: <COMBINED_ALIAS {{.*}} op3=[[ALIASEEID]] |
Mehdi Amini | 2d28f7a | 2016-04-16 06:56:44 +0000 | [diff] [blame] | 33 | ; COMBINED-NEXT: </GLOBALVAL_SUMMARY_BLOCK |
Mehdi Amini | 2d28f7a | 2016-04-16 06:56:44 +0000 | [diff] [blame] | 34 | |
| 35 | ; ModuleID = 'thinlto-function-summary-callgraph.ll' |
| 36 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" |
| 37 | target triple = "x86_64-unknown-linux-gnu" |
| 38 | |
| 39 | ; Function Attrs: nounwind uwtable |
| 40 | define i32 @main() { |
| 41 | entry: |
| 42 | call void (...) @analias() |
| 43 | ret i32 0 |
| 44 | } |
| 45 | |
| 46 | declare void @analias(...) |