Files
clang-p2996/llvm/test/Analysis/CallGraph/llvm-used.ll
Matt Arsenault 7cf5581712 Analysis: Update some tests for opaque pointers
StackSafetyAnalysis/lifetime.ll had one bitcast removed that may have
mattered. The concluded lifetime is longer based on the underlying
alloca, instead of the bitcasted pointer so left that as a pointless
cast.

local.ll memintrin.ll needed some manual fixes
2022-12-02 18:47:43 -05:00

38 lines
1.1 KiB
LLVM

; RUN: opt < %s -print-callgraph -disable-output 2>&1 | FileCheck %s
; The test will report used1 and used2 functions as used on the grounds
; of llvm.*.used references. Passing IgnoreLLVMUsed = true into the
; Function::hasAddressTaken() in the CallGraph::addToCallGraph() has to
; change their uses to zero.
; CHECK: Call graph node <<null function>><<{{.*}}>> #uses=0
; CHECK-NEXT: CS<None> calls function 'used1'
; CHECK-NEXT: CS<None> calls function 'used2'
; CHECK-NEXT: CS<None> calls function 'unused'
; CHECK-EMPTY:
; CHECK-NEXT: Call graph node for function: 'unused'<<{{.*}}>> #uses=1
; CHECK-EMPTY:
; CHECK-NEXT: Call graph node for function: 'used1'<<{{.*}}>> #uses=1
; CHECK-EMPTY:
; CHECK-NEXT: Call graph node for function: 'used2'<<{{.*}}>> #uses=1
; CHECK-EMPTY:
@llvm.used = appending global [1 x ptr] [ptr @used1]
@llvm.compiler.used = appending global [1 x ptr] [ptr @used2]
@array = appending global [1 x ptr] [ptr @unused]
define internal void @used1() {
entry:
ret void
}
define internal void @used2() {
entry:
ret void
}
define internal void @unused() {
entry:
ret void
}