llvm-project/llvm/test/Transforms/GlobalDCE/2002-08-17-FunctionDGE.ll
Matt Arsenault 8570893cfd GlobalDCE: Convert tests to opaque pointers
The script mangled both virtual-functions-base-pointer-call.ll and
virtual-functions-derived-pointer-call.ll pretty badly, deleting the
run line and most of the block comment.

Replaced the bitcast with and addrspacecast in 2002-07-17-CastRef.ll,
based on the apparent intent of the test.

For 2003-07-01-SelfReference.ll, the script produced "call ptr ()
@getfunc" which surprisingly parses as valid.
2022-11-27 21:07:27 -05:00

19 lines
566 B
LLVM

; Make sure that functions are removed successfully if they are referred to by
; a global that is dead. Make sure any globals they refer to die as well.
; RUN: opt < %s -passes=globaldce -S | FileCheck %s
; CHECK-NOT: foo
;; Unused, kills %foo
@b = internal global ptr @foo ; <ptr> [#uses=0]
;; Should die when function %foo is killed
@foo.upgrd.1 = internal global i32 7 ; <ptr> [#uses=1]
;; dies when %b dies.
define internal i32 @foo() {
%ret = load i32, ptr @foo.upgrd.1 ; <i32> [#uses=1]
ret i32 %ret
}