summaryrefslogtreecommitdiffstats
path: root/test/Transforms/IPConstantProp/2008-06-09-WeakProp.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/Transforms/IPConstantProp/2008-06-09-WeakProp.ll')
-rw-r--r--test/Transforms/IPConstantProp/2008-06-09-WeakProp.ll15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/Transforms/IPConstantProp/2008-06-09-WeakProp.ll b/test/Transforms/IPConstantProp/2008-06-09-WeakProp.ll
new file mode 100644
index 0000000..6640336
--- /dev/null
+++ b/test/Transforms/IPConstantProp/2008-06-09-WeakProp.ll
@@ -0,0 +1,15 @@
+; RUN: opt < %s -ipconstprop -S | 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
+}
+