David Majnemer 2869d4800c GlobalDCE: Don't drop any COMDAT members
If we require a single member of a comdat, require all of the other
members as well.

This fixes PR20981.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219191 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-07 07:07:19 +00:00

18 lines
335 B
LLVM

; RUN: opt < %s -globaldce -S | FileCheck %s
$c1 = comdat any
; CHECK: $c1 = comdat any
@a1 = linkonce_odr alias void ()* @f1
; CHECK: @a1 = linkonce_odr alias void ()* @f1
define linkonce_odr void @f1() comdat $c1 {
ret void
}
; CHECK: define linkonce_odr void @f1() comdat $c1
define void @g() {
call void @f1()
ret void
}