1 ; Test to check the callgraph for calls to casts.
2 ; RUN: opt -module-summary %s -o %t.o
3 ; RUN: llvm-bcanalyzer -dump %t.o | FileCheck %s
6 ; CHECK: <GLOBALVAL_SUMMARY_BLOCK
9 ; "op7" is a call to "callee" function.
10 ; CHECK-NEXT: <PERMODULE {{.*}} op9=3 op10=[[ALIASID:[0-9]+]]/>
11 ; "another_caller" has only references but no calls.
12 ; CHECK-NEXT: <PERMODULE {{.*}} op4=3 {{.*}} op9={{[0-9]+}}/>
13 ; CHECK-NEXT: <PERMODULE {{.*}} op0=[[ALIASEEID:[0-9]+]]
14 ; CHECK-NEXT: <ALIAS {{.*}} op0=[[ALIASID]] {{.*}} op2=[[ALIASEEID]]/>
15 ; CHECK-NEXT: <BLOCK_COUNT op0=3/>
16 ; CHECK-NEXT: </GLOBALVAL_SUMMARY_BLOCK>
18 ; ModuleID = 'thinlto-function-summary-callgraph-cast.ll'
19 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
20 target triple = "x86_64-unknown-linux-gnu"
22 define void @caller() {
23 call void bitcast (void (...)* @callee to void ()*)()
24 call void bitcast (void (...)* @analias to void ()*)()
28 define void @another_caller() {
29 ; Test calls that aren't handled either as direct or indirect.
30 call void select (i1 icmp eq (i32* @global, i32* null), void ()* @f, void ()* @g)()
34 declare void @callee(...)
36 @analias = alias void (...), bitcast (void ()* @aliasee to void (...)*)
38 define void @aliasee() {
45 @global = extern_weak global i32