Promote GEP ubyte indices to uint. Backwards compatibility for 1.2 and
older features will be dropped soon and these test cases must not rely
on the upgrade capability.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31896 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Analysis/BasicAA/2003-03-04-GEPCrash.ll b/test/Analysis/BasicAA/2003-03-04-GEPCrash.ll
index 1f48327..8a25031 100644
--- a/test/Analysis/BasicAA/2003-03-04-GEPCrash.ll
+++ b/test/Analysis/BasicAA/2003-03-04-GEPCrash.ll
@@ -1,7 +1,7 @@
 ; RUN: llvm-as < %s | opt -basicaa -aa-eval -disable-output
 ; Test for a bug in BasicAA which caused a crash when querying equality of P1&P2
 void %test({[2 x int],[2 x int]}* %A, long %X, long %Y) {
-	%P1 = getelementptr {[2 x int],[2 x int]}* %A, long 0, ubyte 0, long %X
-	%P2 = getelementptr {[2 x int],[2 x int]}* %A, long 0, ubyte 1, long %Y
+	%P1 = getelementptr {[2 x int],[2 x int]}* %A, long 0, uint 0, long %X
+	%P2 = getelementptr {[2 x int],[2 x int]}* %A, long 0, uint 1, long %Y
 	ret void
 }
diff --git a/test/Analysis/BasicAA/2003-05-21-GEP-Problem.ll b/test/Analysis/BasicAA/2003-05-21-GEP-Problem.ll
index 7322e63..2e95261 100644
--- a/test/Analysis/BasicAA/2003-05-21-GEP-Problem.ll
+++ b/test/Analysis/BasicAA/2003-05-21-GEP-Problem.ll
@@ -6,13 +6,13 @@
 	br label %loopentry
 
 loopentry:		; preds = %0, %no_exit
-	%tmp.101 = getelementptr %struct..apr_table_t* %t.1, long 0, ubyte 0, ubyte 2		; <int*> [#uses=1]
+	%tmp.101 = getelementptr %struct..apr_table_t* %t.1, long 0, uint 0, uint 2
 	%tmp.11 = load int* %tmp.101		; <int> [#uses=0]
 	br bool false, label %no_exit, label %UnifiedExitNode
 
 no_exit:		; preds = %loopentry
 	%tmp.25 = cast int 0 to long		; <long> [#uses=1]
-	%tmp.261 = getelementptr %struct..apr_table_t* %t.1, long 0, ubyte 3, long %tmp.25		; <int*> [#uses=1]
+	%tmp.261 = getelementptr %struct..apr_table_t* %t.1, long 0, uint 3, long %tmp.25		; <int*> [#uses=1]
 	store int 0, int* %tmp.261
 	br label %loopentry
 
diff --git a/test/Analysis/BasicAA/2003-07-03-BasicAACrash.ll b/test/Analysis/BasicAA/2003-07-03-BasicAACrash.ll
index 916b523..942fe9f 100644
--- a/test/Analysis/BasicAA/2003-07-03-BasicAACrash.ll
+++ b/test/Analysis/BasicAA/2003-07-03-BasicAACrash.ll
@@ -6,7 +6,7 @@
 implementation   ; Functions:
 
 uint %BMT_CommitPartDrawObj() {
-	%tmp.19111 = getelementptr %struct..RefRect* null, long 0, ubyte 0, ubyte 1, ubyte 2
-	%tmp.20311 = getelementptr %struct..RefRect* null, long 0, ubyte 1, ubyte 1, ubyte 2
+	%tmp.19111 = getelementptr %struct..RefRect* null, long 0, uint 0, uint 1, uint 2
+	%tmp.20311 = getelementptr %struct..RefRect* null, long 0, uint 1, uint 1, uint 2
 	ret uint 0
 }
diff --git a/test/Analysis/BasicAA/2003-11-04-SimpleCases.ll b/test/Analysis/BasicAA/2003-11-04-SimpleCases.ll
index 2b6c7e1..c030c06 100644
--- a/test/Analysis/BasicAA/2003-11-04-SimpleCases.ll
+++ b/test/Analysis/BasicAA/2003-11-04-SimpleCases.ll
@@ -7,9 +7,9 @@
 
 void %test(%T* %P) {
   %A = getelementptr %T* %P, long 0
-  %B = getelementptr %T* %P, long 0, ubyte 0
-  %C = getelementptr %T* %P, long 0, ubyte 1
-  %D = getelementptr %T* %P, long 0, ubyte 1, long 0
-  %E = getelementptr %T* %P, long 0, ubyte 1, long 5
+  %B = getelementptr %T* %P, long 0, uint 0
+  %C = getelementptr %T* %P, long 0, uint 1
+  %D = getelementptr %T* %P, long 0, uint 1, long 0
+  %E = getelementptr %T* %P, long 0, uint 1, long 5
   ret void
 }
diff --git a/test/Analysis/BasicAA/2003-12-11-ConstExprGEP.ll b/test/Analysis/BasicAA/2003-12-11-ConstExprGEP.ll
index 3b37b2c..f751928 100644
--- a/test/Analysis/BasicAA/2003-12-11-ConstExprGEP.ll
+++ b/test/Analysis/BasicAA/2003-12-11-ConstExprGEP.ll
@@ -8,10 +8,10 @@
 %G = external global %T
 
 void %test() {
-  %D = getelementptr %T* %G, long 0, ubyte 0
-  %E = getelementptr %T* %G, long 0, ubyte 1, long 5
-  %F = getelementptr uint* getelementptr (%T* %G, long 0, ubyte 0), long 0
-  %X = getelementptr [10 x ubyte]* getelementptr (%T* %G, long 0, ubyte 1), long 0, long 5
+  %D = getelementptr %T* %G, long 0, uint 0
+  %E = getelementptr %T* %G, long 0, uint 1, long 5
+  %F = getelementptr uint* getelementptr (%T* %G, long 0, uint 0), long 0
+  %X = getelementptr [10 x ubyte]* getelementptr (%T* %G, long 0, uint 1), long 0, long 5
 
   ret void
 }
diff --git a/test/Analysis/BasicAA/featuretest.ll b/test/Analysis/BasicAA/featuretest.ll
index 7fc129d..d7bec22 100644
--- a/test/Analysis/BasicAA/featuretest.ll
+++ b/test/Analysis/BasicAA/featuretest.ll
@@ -55,9 +55,9 @@
 ; 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
+	%A = getelementptr {int,int}* %A, long 0, uint 0
 	%REMOVEu = load int* %A
-	%B = getelementptr {int,int}* %A, long %distance, ubyte 1
+	%B = getelementptr {int,int}* %A, long %distance, uint 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
@@ -78,7 +78,7 @@
 int %constexpr_test() {
    %X = alloca int
    %Y = load int* %X
-   store int 5, int* getelementptr ({ int }* %Global, long 0, ubyte 0)
+   store int 5, int* getelementptr ({ int }* %Global, long 0, uint 0)
    %REMOVE = load int* %X
    %retval = sub int %Y, %REMOVE
    ret int %retval
diff --git a/test/Analysis/DSGraph/2003-06-29-NodeCollapsing.ll b/test/Analysis/DSGraph/2003-06-29-NodeCollapsing.ll
index ed49a85..db95623 100644
--- a/test/Analysis/DSGraph/2003-06-29-NodeCollapsing.ll
+++ b/test/Analysis/DSGraph/2003-06-29-NodeCollapsing.ll
@@ -5,12 +5,12 @@
 	%A = alloca %T
 	%B = alloca { %T }
 	%C = alloca %T*
-	%Bp = getelementptr { %T }* %B, long 0, ubyte 0
+	%Bp = getelementptr { %T }* %B, long 0, uint 0
 
 	%i0 = alloca int
 	%i1 = alloca int
-	%Ap0 = getelementptr %T* %A, long 0, ubyte 0
-	%Ap1 = getelementptr %T* %A, long 0, ubyte 1
+	%Ap0 = getelementptr %T* %A, long 0, uint 0
+	%Ap1 = getelementptr %T* %A, long 0, uint 1
 	store int* %i0, int** %Ap0
 	store int* %i1, int** %Ap1
 
diff --git a/test/Analysis/DSGraph/2003-06-29-NodeCollapsing2.ll b/test/Analysis/DSGraph/2003-06-29-NodeCollapsing2.ll
index 9909c20..93260e8 100644
--- a/test/Analysis/DSGraph/2003-06-29-NodeCollapsing2.ll
+++ b/test/Analysis/DSGraph/2003-06-29-NodeCollapsing2.ll
@@ -9,8 +9,8 @@
 	%A = alloca %T
 	%B = alloca { %T }
 	%C = alloca %T*
-	%Bp = getelementptr { %T }* %B, long 0, ubyte 0
-	%Ap = getelementptr %T* %A, long 0, ubyte 0
+	%Bp = getelementptr { %T }* %B, long 0, uint 0
+	%Ap = getelementptr %T* %A, long 0, uint 0
 
 	store %T* %A, %T** %C
 	store %T* %Bp, %T** %C    ; This store was causing merging to happen!
diff --git a/test/Analysis/DSGraph/2003-07-01-FieldCollapse.ll b/test/Analysis/DSGraph/2003-07-01-FieldCollapse.ll
index fe13567..a0ab492 100644
--- a/test/Analysis/DSGraph/2003-07-01-FieldCollapse.ll
+++ b/test/Analysis/DSGraph/2003-07-01-FieldCollapse.ll
@@ -6,6 +6,6 @@
 
 
 void %test() {
-	store short 5, short* getelementptr ({ int, short, short }* %X, long 0, ubyte 1)
+	store short 5, short* getelementptr ({ int, short, short }* %X, long 0, uint 1)
 	ret void
 }
diff --git a/test/Analysis/DSGraph/2003-11-02-NodeCollapsing.ll b/test/Analysis/DSGraph/2003-11-02-NodeCollapsing.ll
index 846a3cb..416fc25 100644
--- a/test/Analysis/DSGraph/2003-11-02-NodeCollapsing.ll
+++ b/test/Analysis/DSGraph/2003-11-02-NodeCollapsing.ll
@@ -11,8 +11,8 @@
 	%A = alloca double*
 	%B = alloca %S
 	%C = alloca %T
-	%b = getelementptr %S* %B, long 0, ubyte 0
-	%c = getelementptr %T* %C, long 0, ubyte 0
+	%b = getelementptr %S* %B, long 0, uint 0
+	%c = getelementptr %T* %C, long 0, uint 0
 
 	store double* %b, double** %A
 	store double* %c, double** %A
diff --git a/test/Analysis/DSGraph/2005-03-22-IncompleteGlobal.ll b/test/Analysis/DSGraph/2005-03-22-IncompleteGlobal.ll
index 182876c..86b0533 100644
--- a/test/Analysis/DSGraph/2005-03-22-IncompleteGlobal.ll
+++ b/test/Analysis/DSGraph/2005-03-22-IncompleteGlobal.ll
@@ -6,7 +6,7 @@
 %G = external global %S
 
 void %main() {
-	%b = getelementptr %S* %G, long 0, ubyte 0
+	%b = getelementptr %S* %G, long 0, uint 0
 	store double 0.1, double* %b
 	ret void
 }
diff --git a/test/Analysis/DSGraph/PhysicalSubtyping.ll b/test/Analysis/DSGraph/PhysicalSubtyping.ll
index cdc2cf0..6e9676e 100644
--- a/test/Analysis/DSGraph/PhysicalSubtyping.ll
+++ b/test/Analysis/DSGraph/PhysicalSubtyping.ll
@@ -7,9 +7,9 @@
 
 int %main() {
 	%A = alloca %S
-	%Ap = getelementptr %S* %A, long 0, ubyte 0
+	%Ap = getelementptr %S* %A, long 0, uint 0
 	%B = alloca %T
-	%Bp = getelementptr %T* %B, long 0, ubyte 0
+	%Bp = getelementptr %T* %B, long 0, uint 0
 	%C = alloca int*
 	
 	store int* %Ap, int** %C
diff --git a/test/Analysis/DSGraph/gcsetest.ll b/test/Analysis/DSGraph/gcsetest.ll
index 37600a8..b9b28c4 100644
--- a/test/Analysis/DSGraph/gcsetest.ll
+++ b/test/Analysis/DSGraph/gcsetest.ll
@@ -10,21 +10,21 @@
 	%Ap = malloc int
 	%Bp = malloc int
  	%C  = malloc {int*, int*}
-	%C1p = getelementptr {int*, int*}* %C, long 0, ubyte 0
+	%C1p = getelementptr {int*, int*}* %C, long 0, uint 0
 	store int* %Ap, int** %C1p
-	%C2p = getelementptr {int*, int*}* %C, long 0, ubyte 1
+	%C2p = getelementptr {int*, int*}* %C, long 0, uint 1
 	store int* %Bp, int** %C2p
 	ret %intpair* %C
 }
 
 int* %getp(%intpair* %P) {
-	%pp = getelementptr %intpair* %P, long 0, ubyte 0
+	%pp = getelementptr %intpair* %P, long 0, uint 0
 	%V = load int** %pp
 	ret int *%V
 }
 
 int* %getq(%intpair* %P) {
-	%pp = getelementptr %intpair* %P, long 0, ubyte 1
+	%pp = getelementptr %intpair* %P, long 0, uint 1
 	%V = load int** %pp
 	ret int *%V
 }
diff --git a/test/Analysis/LoadVN/dependent_loads.ll b/test/Analysis/LoadVN/dependent_loads.ll
index 959628f..331ba21 100644
--- a/test/Analysis/LoadVN/dependent_loads.ll
+++ b/test/Analysis/LoadVN/dependent_loads.ll
@@ -15,11 +15,11 @@
 
 sbyte %test(%S ** %P) {
 	%A = load %S** %P
-	%B = getelementptr %S* %A, int 0, ubyte 1
+	%B = getelementptr %S* %A, int 0, uint 1
 	%C = load sbyte* %B
 
 	%X = load %S** %P
-	%Y = getelementptr %S* %X, int 0, ubyte 1
+	%Y = getelementptr %S* %X, int 0, uint 1
 	%Z = load sbyte* %Y
 
 	%R = sub sbyte %C, %Z