1 ; RUN: opt < %s -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 'unused'
13 ; CHECK-NEXT: Call graph node for function: 'unused'<<{{.*}}>> #uses=1
15 ; CHECK-NEXT: Call graph node for function: 'used1'<<{{.*}}>> #uses=1
17 ; CHECK-NEXT: Call graph node for function: 'used2'<<{{.*}}>> #uses=1
20 @llvm.used = appending global [1 x i8*] [i8* bitcast (void ()* @used1 to i8*)]
21 @llvm.compiler.used = appending global [1 x void()*] [void ()* @used2]
22 @array = appending global [1 x i8*] [i8* bitcast (void ()* @unused to i8*)]
24 define internal void @used1() {
29 define internal void @used2() {
34 define internal void @unused() {