summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/GlobalDCE/2002-08-17-FunctionDGE.ll
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/Transforms/GlobalDCE/2002-08-17-FunctionDGE.ll')
-rw-r--r--llvm/test/Transforms/GlobalDCE/2002-08-17-FunctionDGE.ll16
1 files changed, 16 insertions, 0 deletions
diff --git a/llvm/test/Transforms/GlobalDCE/2002-08-17-FunctionDGE.ll b/llvm/test/Transforms/GlobalDCE/2002-08-17-FunctionDGE.ll
new file mode 100644
index 00000000000..e0af3c2c487
--- /dev/null
+++ b/llvm/test/Transforms/GlobalDCE/2002-08-17-FunctionDGE.ll
@@ -0,0 +1,16 @@
+; 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: llvm-upgrade < %s | llvm-as | opt -globaldce | llvm-dis | not grep foo
+
+%b = internal global int ()* %foo ;; Unused, kills %foo
+
+%foo = internal global int 7 ;; Should die when function %foo is killed
+
+implementation
+
+internal int %foo() { ;; dies when %b dies.
+ %ret = load int* %foo
+ ret int %ret
+}
+
OpenPOWER on IntegriCloud