diff options
author | Christopher Lamb <christopher.lamb@gmail.com> | 2007-08-02 01:18:14 +0000 |
---|---|---|
committer | Christopher Lamb <christopher.lamb@gmail.com> | 2007-08-02 01:18:14 +0000 |
commit | 406bfa3e21e8fab3deab240c30c763e78eddf2f5 (patch) | |
tree | 589affc9709d498e55ec8ebb5994063773431aa6 /test/Analysis | |
parent | 8409747efadda025aa3cce626b1a2c33429fd5e5 (diff) | |
download | external_llvm-406bfa3e21e8fab3deab240c30c763e78eddf2f5.zip external_llvm-406bfa3e21e8fab3deab240c30c763e78eddf2f5.tar.gz external_llvm-406bfa3e21e8fab3deab240c30c763e78eddf2f5.tar.bz2 |
Teach BasicAA about noalias parameter attributes, but do it correctly this time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40711 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis')
-rw-r--r-- | test/Analysis/BasicAA/2007-08-01-NoAliasAndCalls.ll | 10 | ||||
-rw-r--r-- | test/Analysis/BasicAA/2007-08-01-NoAliasAndGEP.ll | 17 |
2 files changed, 27 insertions, 0 deletions
diff --git a/test/Analysis/BasicAA/2007-08-01-NoAliasAndCalls.ll b/test/Analysis/BasicAA/2007-08-01-NoAliasAndCalls.ll new file mode 100644 index 0000000..072bfd9 --- /dev/null +++ b/test/Analysis/BasicAA/2007-08-01-NoAliasAndCalls.ll @@ -0,0 +1,10 @@ +; RUN: llvm-as %s -o - | opt -basicaa -aa-eval -print-all-alias-modref-info -disable-output &| grep 'MayAlias: i32* %y, i32* %x' + +declare i32* @unclear(i32* %a) + +define void @foo(i32* noalias %x) { + %y = call i32* @unclear(i32* %x) + store i32 0, i32* %x + store i32 0, i32* %y + ret void +} diff --git a/test/Analysis/BasicAA/2007-08-01-NoAliasAndGEP.ll b/test/Analysis/BasicAA/2007-08-01-NoAliasAndGEP.ll new file mode 100644 index 0000000..8cc9f06 --- /dev/null +++ b/test/Analysis/BasicAA/2007-08-01-NoAliasAndGEP.ll @@ -0,0 +1,17 @@ +; RUN: llvm-as %s -o - | opt -basicaa -aa-eval -print-all-alias-modref-info -disable-output &| grep '9 no alias' +; RUN: llvm-as %s -o - | opt -basicaa -aa-eval -print-all-alias-modref-info -disable-output &| grep '6 may alias' +; RUN: llvm-as %s -o - | opt -basicaa -aa-eval -print-all-alias-modref-info -disable-output &| grep 'MayAlias: i32* %pj, i32* %pi' + +define void @foo(i32* noalias %p, i32* noalias %q, i32 %i, i32 %j) { + %pi = getelementptr i32* %p, i32 %i + %qi = getelementptr i32* %q, i32 %i + %pj = getelementptr i32* %p, i32 %j + %qj = getelementptr i32* %q, i32 %j + store i32 0, i32* %p + store i32 0, i32* %pi + store i32 0, i32* %pj + store i32 0, i32* %q + store i32 0, i32* %qi + store i32 0, i32* %qj + ret void +} |