summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-08-18 01:27:10 +0000
committerChris Lattner <sabre@nondot.org>2002-08-18 01:27:10 +0000
commit09540e2cc54337dd54330d38e3d1adcde7edab91 (patch)
tree21ac8b93deabaf172417d8f85def3f84dc4e1079 /test
parent41661fdb2e963610b399c8ebe51a507847ef997d (diff)
downloadexternal_llvm-09540e2cc54337dd54330d38e3d1adcde7edab91.zip
external_llvm-09540e2cc54337dd54330d38e3d1adcde7edab91.tar.gz
external_llvm-09540e2cc54337dd54330d38e3d1adcde7edab91.tar.bz2
New testcase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3380 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Transforms/GlobalDCE/2002-08-17-FunctionDGE.ll19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/Transforms/GlobalDCE/2002-08-17-FunctionDGE.ll b/test/Transforms/GlobalDCE/2002-08-17-FunctionDGE.ll
new file mode 100644
index 0000000..57ed72a
--- /dev/null
+++ b/test/Transforms/GlobalDCE/2002-08-17-FunctionDGE.ll
@@ -0,0 +1,19 @@
+; 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: if as < %s | opt -globaldce | dis | grep foo
+; RUN: then exit 1
+; RUN: else exit 0
+; RUN: fi
+
+%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
+}
+