summaryrefslogtreecommitdiff
path: root/test/Transforms/FunctionAttrs/2008-12-29-Constant.ll
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2008-12-31 16:14:43 +0000
committerDuncan Sands <baldrick@free.fr>2008-12-31 16:14:43 +0000
commit9e89ba31f16a960239a750a26a982b4c9dfe8949 (patch)
tree4b985f2525e7c6470e7a9d345b5c7eb7ffa889fe /test/Transforms/FunctionAttrs/2008-12-29-Constant.ll
parent0c913735c7f66d6bcf0807fac4018a867c3a77e0 (diff)
downloadllvm-9e89ba31f16a960239a750a26a982b4c9dfe8949.tar.gz
llvm-9e89ba31f16a960239a750a26a982b4c9dfe8949.tar.bz2
llvm-9e89ba31f16a960239a750a26a982b4c9dfe8949.tar.xz
Rename AddReadAttrs to FunctionAttrs, and teach it how
to work out (in a very simplistic way) which function arguments (pointer arguments only) are only dereferenced and so do not escape. Mark such arguments 'nocapture'. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61525 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/FunctionAttrs/2008-12-29-Constant.ll')
-rw-r--r--test/Transforms/FunctionAttrs/2008-12-29-Constant.ll8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/Transforms/FunctionAttrs/2008-12-29-Constant.ll b/test/Transforms/FunctionAttrs/2008-12-29-Constant.ll
new file mode 100644
index 0000000000..d9c01171ac
--- /dev/null
+++ b/test/Transforms/FunctionAttrs/2008-12-29-Constant.ll
@@ -0,0 +1,8 @@
+; RUN: llvm-as < %s | opt -functionattrs | llvm-dis | grep readnone
+
+@s = external constant i8 ; <i8*> [#uses=1]
+
+define i8 @f() {
+ %tmp = load i8* @s ; <i8> [#uses=1]
+ ret i8 %tmp
+}