summaryrefslogtreecommitdiff
path: root/test/Transforms/FunctionAttrs
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2009-05-06 08:42:00 +0000
committerDuncan Sands <baldrick@free.fr>2009-05-06 08:42:00 +0000
commitcfd0ebea276521a48370c197e651064b032a381e (patch)
tree6d6d8f9492a95f79c57e687c3725ccb7da65678d /test/Transforms/FunctionAttrs
parentd8d27f4a4b9461aee581217691d896d4eba985fa (diff)
downloadllvm-cfd0ebea276521a48370c197e651064b032a381e.tar.gz
llvm-cfd0ebea276521a48370c197e651064b032a381e.tar.bz2
llvm-cfd0ebea276521a48370c197e651064b032a381e.tar.xz
Fix PR3754: don't mark functions that wrap MallocInst with
the readnone. Since MallocInst is scheduled for deletion it doesn't seem worth doing anything more subtle, such as having mayWriteToMemory return true for MallocInst. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71077 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/FunctionAttrs')
-rw-r--r--test/Transforms/FunctionAttrs/2009-05-06-Malloc.ll7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/Transforms/FunctionAttrs/2009-05-06-Malloc.ll b/test/Transforms/FunctionAttrs/2009-05-06-Malloc.ll
new file mode 100644
index 0000000000..4022033c3b
--- /dev/null
+++ b/test/Transforms/FunctionAttrs/2009-05-06-Malloc.ll
@@ -0,0 +1,7 @@
+; RUN: llvm-as < %s | opt -functionattrs | llvm-dis | not grep read
+; PR3754
+
+define i8* @m(i32 %size) {
+ %tmp = malloc i8, i32 %size ; <i8*> [#uses=1]
+ ret i8* %tmp
+}