summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms
diff options
context:
space:
mode:
authorMehdi Amini <mehdi.amini@apple.com>2016-09-15 20:26:27 +0000
committerMehdi Amini <mehdi.amini@apple.com>2016-09-15 20:26:27 +0000
commitd880309835d89413b5cbf4e586d9d0ece4556ece (patch)
treec6eadbba3efbe70f012e8a56f226490b396491fc /llvm/test/Transforms
parent3045d703f6a6fb73edafb80f3142d2d7266af9ec (diff)
downloadbcm5719-llvm-d880309835d89413b5cbf4e586d9d0ece4556ece.tar.gz
bcm5719-llvm-d880309835d89413b5cbf4e586d9d0ece4556ece.zip
[GlobalOpt] Dead Eliminate declarations
GlobalOpt is already dead-code-eliminating global definitions. With this change it also takes care of declarations. Hopefully this should make it now a strict superset of GlobalDCE. This is important for LTO/ThinLTO as we don't want the linker to see "undefined reference" when it processes the input files: it could prevent proper internalization (or even load an extra file from a static archive, changing the behavior of the program!). llvm-svn: 281653
Diffstat (limited to 'llvm/test/Transforms')
-rw-r--r--llvm/test/Transforms/GlobalOpt/deaddeclaration.ll7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/test/Transforms/GlobalOpt/deaddeclaration.ll b/llvm/test/Transforms/GlobalOpt/deaddeclaration.ll
new file mode 100644
index 00000000000..942f2e1bf6b
--- /dev/null
+++ b/llvm/test/Transforms/GlobalOpt/deaddeclaration.ll
@@ -0,0 +1,7 @@
+; RUN: opt < %s -globalopt -S | FileCheck %s
+
+; CHECK-NOT: aa
+; CHECK-NOT: bb
+
+declare void @aa()
+@bb = external global i8
OpenPOWER on IntegriCloud