summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2014-10-08 19:32:32 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2014-10-08 19:32:32 +0000
commitac07703842cfa40d135145e10440d777e4c37356 (patch)
tree9f5186fef57023d93ed7be1043c09b02628cd7fb /llvm/test
parentce1af1a201c8dc05c05fd1f36a731e0a0fc5b43d (diff)
downloadbcm5719-llvm-ac07703842cfa40d135145e10440d777e4c37356.tar.gz
bcm5719-llvm-ac07703842cfa40d135145e10440d777e4c37356.zip
Inliner: Non-local functions in COMDATs shouldn't be dropped
A function with discardable linkage cannot be discarded if its a member of a COMDAT group without considering all the other COMDAT members as well. This sort of thing is already handled by GlobalOpt/GlobalDCE. This fixes PR21206. llvm-svn: 219335
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Transforms/Inline/pr21206.ll18
1 files changed, 18 insertions, 0 deletions
diff --git a/llvm/test/Transforms/Inline/pr21206.ll b/llvm/test/Transforms/Inline/pr21206.ll
new file mode 100644
index 00000000000..1a4366ecdb8
--- /dev/null
+++ b/llvm/test/Transforms/Inline/pr21206.ll
@@ -0,0 +1,18 @@
+; RUN: opt < %s -inline -S | FileCheck %s
+
+$c = comdat any
+; CHECK: $c = comdat any
+
+define linkonce_odr void @foo() comdat $c {
+ ret void
+}
+; CHECK: define linkonce_odr void @foo() comdat $c
+
+define linkonce_odr void @bar() comdat $c {
+ ret void
+}
+; CHECK: define linkonce_odr void @bar() comdat $c
+
+define void()* @zed() {
+ ret void()* @foo
+}
OpenPOWER on IntegriCloud