diff options
author | Bjorn Steinbrink <bsteinbr@gmail.com> | 2015-05-25 19:46:38 +0000 |
---|---|---|
committer | Bjorn Steinbrink <bsteinbr@gmail.com> | 2015-05-25 19:46:38 +0000 |
commit | 236446cd4c32233f42f513a552bbcc29de020ff4 (patch) | |
tree | db1cc8f3b48b8d74c17162480670f67a22b50de1 /llvm/test/Transforms/FunctionAttrs/readnone.ll | |
parent | f071bd0a18873098507fe2728f8eb96338896a2a (diff) | |
download | bcm5719-llvm-236446cd4c32233f42f513a552bbcc29de020ff4.tar.gz bcm5719-llvm-236446cd4c32233f42f513a552bbcc29de020ff4.zip |
Remove conflicting attributes before adding deduced readonly/readnone
Summary:
In case of functions that have a pointer argument and only pass it to
each other, the function attributes pass deduces that the pointer should
get the readnone attribute, but fails to remove a readonly attribute
that may already have been present.
Reviewers: nlewycky
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D9995
llvm-svn: 238152
Diffstat (limited to 'llvm/test/Transforms/FunctionAttrs/readnone.ll')
-rw-r--r-- | llvm/test/Transforms/FunctionAttrs/readnone.ll | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/test/Transforms/FunctionAttrs/readnone.ll b/llvm/test/Transforms/FunctionAttrs/readnone.ll new file mode 100644 index 00000000000..eddcdd2641d --- /dev/null +++ b/llvm/test/Transforms/FunctionAttrs/readnone.ll @@ -0,0 +1,13 @@ +; RUN: opt < %s -functionattrs -S | FileCheck %s + +; CHECK: define void @bar(i8* nocapture readnone) +define void @bar(i8* readonly) { + call void @foo(i8* %0) + ret void +} + +; CHECK: define void @foo(i8* nocapture readnone) +define void @foo(i8* readonly) { + call void @bar(i8* %0) + ret void +} |