1 ; RUN: opt < %s -passes=print-callgraph -disable-output 2>&1 | FileCheck %s
3 ; The test will report used1 and used2 functions as used on the grounds
4 ; of llvm.*.used references. Passing IgnoreLLVMUsed = true into the
5 ; Function::hasAddressTaken() in the CallGraph::addToCallGraph() has to
6 ; change their uses to zero.
8 ; CHECK: Call graph node <<null function>><<{{.*}}>> #uses=0
9 ; CHECK-NEXT: CS<None> calls function 'used1'
10 ; CHECK-NEXT: CS<None> calls function 'used2'
11 ; CHECK-NEXT: CS<None> calls function 'used_addrspace1'
12 ; CHECK-NEXT: CS<None> calls function 'unused'
14 ; CHECK-NEXT: Call graph node for function: 'unused'<<{{.*}}>> #uses=1
16 ; CHECK-NEXT: Call graph node for function: 'used1'<<{{.*}}>> #uses=1
18 ; CHECK-NEXT: Call graph node for function: 'used2'<<{{.*}}>> #uses=1
20 ; CHECK-NEXT: Call graph node for function: 'used_addrspace1'<<{{.*}}>> #uses=1
23 @llvm.used = appending global [2 x ptr] [ptr @used1, ptr addrspacecast (ptr addrspace(1) @used_addrspace1 to ptr)]
24 @llvm.compiler.used = appending global [1 x ptr] [ptr @used2]
25 @array = appending global [1 x ptr] [ptr @unused]
27 define internal void @used1() {
32 define internal void @used2() {
37 define internal void @used_addrspace1() addrspace(1) {
42 define internal void @unused() {