aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/Analysis/BasicAA/featuretest.ll14
-rw-r--r--test/Transforms/BasicAA/featuretest.ll14
2 files changed, 28 insertions, 0 deletions
diff --git a/test/Analysis/BasicAA/featuretest.ll b/test/Analysis/BasicAA/featuretest.ll
index 26516d5519..803dafb676 100644
--- a/test/Analysis/BasicAA/featuretest.ll
+++ b/test/Analysis/BasicAA/featuretest.ll
@@ -6,6 +6,10 @@
; RUN: else exit 0
; RUN: fi
+%Global = external global { int }
+
+implementation
+
; Array test: Test that operations on one local array do not invalidate
; operations on another array. Important for scientific codes.
@@ -72,3 +76,13 @@ int %gep_distance_test3(int * %A) {
%Y = load sbyte* %C
ret int 8
}
+
+; Test that we can disambiguate globals reached through constantexpr geps
+int %constexpr_test() {
+ %X = alloca int
+ %Y = load int* %X
+ store int 5, int* getelementptr ({ int }* %Global, long 0, ubyte 0)
+ %REMOVE = load int* %X
+ %retval = sub int %Y, %REMOVE
+ ret int %retval
+}
diff --git a/test/Transforms/BasicAA/featuretest.ll b/test/Transforms/BasicAA/featuretest.ll
index 26516d5519..803dafb676 100644
--- a/test/Transforms/BasicAA/featuretest.ll
+++ b/test/Transforms/BasicAA/featuretest.ll
@@ -6,6 +6,10 @@
; RUN: else exit 0
; RUN: fi
+%Global = external global { int }
+
+implementation
+
; Array test: Test that operations on one local array do not invalidate
; operations on another array. Important for scientific codes.
@@ -72,3 +76,13 @@ int %gep_distance_test3(int * %A) {
%Y = load sbyte* %C
ret int 8
}
+
+; Test that we can disambiguate globals reached through constantexpr geps
+int %constexpr_test() {
+ %X = alloca int
+ %Y = load int* %X
+ store int 5, int* getelementptr ({ int }* %Global, long 0, ubyte 0)
+ %REMOVE = load int* %X
+ %retval = sub int %Y, %REMOVE
+ ret int %retval
+}