summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-05-13 17:39:14 +0000
committerChris Lattner <sabre@nondot.org>2009-05-13 17:39:14 +0000
commitaab6ec49d24e8ecec766cf90954a3a58c64bf7c4 (patch)
treed1172f014f0021a86adc76b5fc995f5bf23fce61 /test
parentad6585b021ed88cd91a72712cbc600c903143d7c (diff)
downloadllvm-aab6ec49d24e8ecec766cf90954a3a58c64bf7c4.tar.gz
llvm-aab6ec49d24e8ecec766cf90954a3a58c64bf7c4.tar.bz2
llvm-aab6ec49d24e8ecec766cf90954a3a58c64bf7c4.tar.xz
calls in nothrow functions can be marked nothrow even if the callee
is not known to be nothrow. This allows readnone/readonly functions to be deleted even if we don't know whether the callee can throw. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71676 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Transforms/InstCombine/nothrow.ll8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/nothrow.ll b/test/Transforms/InstCombine/nothrow.ll
new file mode 100644
index 0000000000..fbf162a1db
--- /dev/null
+++ b/test/Transforms/InstCombine/nothrow.ll
@@ -0,0 +1,8 @@
+; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep call
+; rdar://6880732
+declare double @t1(i32) readonly
+
+define void @t2() nounwind {
+ call double @t1(i32 42) ;; dead call even though callee is not nothrow.
+ ret void
+}