Add new testcase
authorChris Lattner <sabre@nondot.org>
Tue, 17 Jun 2003 15:16:35 +0000 (15:16 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 17 Jun 2003 15:16:35 +0000 (15:16 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6739 91177308-0d34-0410-b5e6-96231b3b80d8

test/Analysis/BasicAA/featuretest.ll
test/Transforms/BasicAA/featuretest.ll

index 26516d551955435dfb5c7aa0928622d17e2307bf..803dafb676861029194da8bb5740f4d8940811b7 100644 (file)
@@ -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
+}
index 26516d551955435dfb5c7aa0928622d17e2307bf..803dafb676861029194da8bb5740f4d8940811b7 100644 (file)
@@ -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
+}