aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-02-25 21:43:37 +0000
committerChris Lattner <sabre@nondot.org>2003-02-25 21:43:37 +0000
commit7b9b1f9ad3c506b1ccc5bb93b2f9e655ca050714 (patch)
treef8c5f15ce5889b78518bbe16f3d71f838df95301
parent006a4a59905fd1d32bca5cc0426d1754a92746fa (diff)
Add a new test for basicaa
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5625 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/Analysis/BasicAA/featuretest.ll11
-rw-r--r--test/Transforms/BasicAA/featuretest.ll11
2 files changed, 22 insertions, 0 deletions
diff --git a/test/Analysis/BasicAA/featuretest.ll b/test/Analysis/BasicAA/featuretest.ll
index 6884df2db5..cd57ef1a79 100644
--- a/test/Analysis/BasicAA/featuretest.ll
+++ b/test/Analysis/BasicAA/featuretest.ll
@@ -51,3 +51,14 @@ int %gep_distance_test(int* %A) {
ret int %r
}
+; Test that if two pointers are spaced out by a constant offset, that they
+; cannot alias, even if there is a variable offset between them...
+int %gep_distance_test2({int,int}* %A, long %distance) {
+ %A = getelementptr {int,int}* %A, long 0, ubyte 0
+ %REMOVEu = load int* %A
+ %B = getelementptr {int,int}* %A, long %distance, ubyte 1
+ store int 7, int* %B ; B cannot alias A, it's at least 4 bytes away
+ %REMOVEv = load int* %A
+ %r = sub int %REMOVEu, %REMOVEv
+ ret int %r
+}
diff --git a/test/Transforms/BasicAA/featuretest.ll b/test/Transforms/BasicAA/featuretest.ll
index 6884df2db5..cd57ef1a79 100644
--- a/test/Transforms/BasicAA/featuretest.ll
+++ b/test/Transforms/BasicAA/featuretest.ll
@@ -51,3 +51,14 @@ int %gep_distance_test(int* %A) {
ret int %r
}
+; Test that if two pointers are spaced out by a constant offset, that they
+; cannot alias, even if there is a variable offset between them...
+int %gep_distance_test2({int,int}* %A, long %distance) {
+ %A = getelementptr {int,int}* %A, long 0, ubyte 0
+ %REMOVEu = load int* %A
+ %B = getelementptr {int,int}* %A, long %distance, ubyte 1
+ store int 7, int* %B ; B cannot alias A, it's at least 4 bytes away
+ %REMOVEv = load int* %A
+ %r = sub int %REMOVEu, %REMOVEv
+ ret int %r
+}