summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/IPConstantProp/2008-06-09-WeakProp.ll
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-06-09 07:58:07 +0000
committerChris Lattner <sabre@nondot.org>2008-06-09 07:58:07 +0000
commitdbd595f22dcae94306df84f70e9a22614034dac4 (patch)
tree3803d3250422310ad8e32220fd6c98b855c03d78 /llvm/test/Transforms/IPConstantProp/2008-06-09-WeakProp.ll
parent54a6cbf12af79068f9f0045d6a738d44e8598c25 (diff)
downloadbcm5719-llvm-dbd595f22dcae94306df84f70e9a22614034dac4.tar.gz
bcm5719-llvm-dbd595f22dcae94306df84f70e9a22614034dac4.zip
Fix PR2411, where ip constant prop would propagate the
result of a weak function. llvm-svn: 52137
Diffstat (limited to 'llvm/test/Transforms/IPConstantProp/2008-06-09-WeakProp.ll')
-rw-r--r--llvm/test/Transforms/IPConstantProp/2008-06-09-WeakProp.ll15
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/test/Transforms/IPConstantProp/2008-06-09-WeakProp.ll b/llvm/test/Transforms/IPConstantProp/2008-06-09-WeakProp.ll
new file mode 100644
index 00000000000..fc7e3bba38a
--- /dev/null
+++ b/llvm/test/Transforms/IPConstantProp/2008-06-09-WeakProp.ll
@@ -0,0 +1,15 @@
+; RUN: llvm-as < %s | opt -ipconstprop | llvm-dis | grep {ret i32 %r}
+; Should not propagate the result of a weak function.
+; PR2411
+
+define weak i32 @foo() nounwind {
+entry:
+ ret i32 1
+}
+
+define i32 @main() nounwind {
+entry:
+ %r = call i32 @foo( ) nounwind
+ ret i32 %r
+}
+
OpenPOWER on IntegriCloud