[llvm-commits] CVS: llvm/test/Feature/constexpr.ll constexprbad.ll forwardreftest.ll recursivetype.ll testalloca.ll testconstants.ll testmemory.ll

Chris Lattner lattner at cs.uiuc.edu
Sun Oct 6 17:44:01 PDT 2002


Changes in directory llvm/test/Feature:

constexpr.ll updated: 1.4 -> 1.5
constexprbad.ll updated: 1.1 -> 1.2
forwardreftest.ll updated: 1.4 -> 1.5
recursivetype.ll updated: 1.3 -> 1.4
testalloca.ll updated: 1.4 -> 1.5
testconstants.ll updated: 1.4 -> 1.5
testmemory.ll updated: 1.5 -> 1.6

---
Log message:

  - Cleaned up all of the test/Feature tests to not use uint's with 
    getelementptr instructions and not to add pointers.


---
Diffs of the changes:

Index: llvm/test/Feature/constexpr.ll
diff -u llvm/test/Feature/constexpr.ll:1.4 llvm/test/Feature/constexpr.ll:1.5
--- llvm/test/Feature/constexpr.ll:1.4	Thu Aug 15 16:14:39 2002
+++ llvm/test/Feature/constexpr.ll	Sun Oct  6 17:43:49 2002
@@ -25,17 +25,17 @@
 ;;---------------------------------------------------
 
 %array  = constant [2 x int] [ int 12, int 52 ]
-%arrayPtr = global int* getelementptr ([2 x int]* %array, uint 0, uint 0)    ;; int* &%array[0][0]
-%arrayPtr5 = global int* getelementptr (int** %arrayPtr, uint 0, uint 5)    ;; int* &%arrayPtr[5]
+%arrayPtr = global int* getelementptr ([2 x int]* %array, long 0, long 0)    ;; int* &%array[0][0]
+%arrayPtr5 = global int* getelementptr (int** %arrayPtr, long 0, long 5)    ;; int* &%arrayPtr[5]
 
 %somestr = constant [11x sbyte] c"hello world"
-%char5  = global sbyte* getelementptr([11x sbyte]* %somestr, uint 0, uint 5)
+%char5  = global sbyte* getelementptr([11x sbyte]* %somestr, long 0, long 5)
 
 ;; cast of getelementptr
-%char8a = global int* cast (sbyte* getelementptr([11x sbyte]* %somestr, uint 0, uint 8) to int*)
+%char8a = global int* cast (sbyte* getelementptr([11x sbyte]* %somestr, long 0, long 8) to int*)
 
 ;; getelementptr containing casts
-%char8b = global sbyte* getelementptr([11x sbyte]* %somestr, uint cast (ubyte 0 to uint), uint cast (sbyte 8 to uint))
+%char8b = global sbyte* getelementptr([11x sbyte]* %somestr, long cast (ubyte 0 to long), long cast (sbyte 8 to long))
 
 ;;-------------------------------------------------------
 ;; TODO: Test constant getelementpr expressions for structures
@@ -54,17 +54,17 @@
 %S3  = global %SAType* %S3c		    ;; Ref. to constant S3
 
 					    ;; Pointer to float (**%S1).1.0
-%S1fld1a = global float* getelementptr (%SType** %S1, uint 0, uint 0, ubyte 1, ubyte 0)
+%S1fld1a = global float* getelementptr (%SType** %S1, long 0, long 0, ubyte 1, ubyte 0)
 					    ;; Another ptr to the same!
-%S1fld1b = global float* getelementptr (%SType*** %S1ptr, uint 0, uint 0, uint 0, ubyte 1, ubyte 0)
+%S1fld1b = global float* getelementptr (%SType*** %S1ptr, long 0, long 0, long 0, ubyte 1, ubyte 0)
 
 %S1fld1bptr = global float** %S1fld1b	    ;; Ref. to previous pointer
 
 					    ;; Pointer to ubyte (**%S2).1.1.0
-%S2fld3 = global ubyte* getelementptr (%SType** %S2, uint 0, uint 0, ubyte 1, ubyte 1, ubyte 0) 
+%S2fld3 = global ubyte* getelementptr (%SType** %S2, long 0, long 0, ubyte 1, ubyte 1, ubyte 0) 
 
 					    ;; Pointer to float (**%S2).1.0[0]
-%S3fld3 = global float* getelementptr (%SAType** %S3, uint 0, uint 0, ubyte 1, ubyte 0, uint 0) 
+%S3fld3 = global float* getelementptr (%SAType** %S3, long 0, long 0, ubyte 1, ubyte 0, long 0) 
 
 ;;---------------------------------------------------------
 ;; TODO: Test constant expressions for unary and binary operators
@@ -77,9 +77,9 @@
 
 %t4 = global int** cast (uint** %t3 to int**)
 
-%char8a = global int* cast (sbyte* getelementptr([11x sbyte]* %somestr, uint 0, uint 8) to int*)
+%char8a = global int* cast (sbyte* getelementptr([11x sbyte]* %somestr, long 0, long 8) to int*)
 
-%S3fld3 = global float* getelementptr (%SAType** %S3, uint 0, uint 0, ubyte 1, ubyte 0, uint 0) 
+%S3fld3 = global float* getelementptr (%SAType** %S3, long 0, long 0, ubyte 1, ubyte 0, long 0) 
 
 
 ;;---------------------------------------------------


Index: llvm/test/Feature/constexprbad.ll
diff -u llvm/test/Feature/constexprbad.ll:1.1 llvm/test/Feature/constexprbad.ll:1.2
--- llvm/test/Feature/constexprbad.ll:1.1	Sun Jul 14 17:39:02 2002
+++ llvm/test/Feature/constexprbad.ll	Sun Oct  6 17:43:49 2002
@@ -23,19 +23,19 @@
 ;;---------------------------------------------------
 
 ;; return value must be a pointer to the element
-;%geperr1 = global sbyte getelementptr([11x sbyte]* %somestr, uint 0, uint 8)
+;%geperr1 = global sbyte getelementptr([11x sbyte]* %somestr, long 0, long 8)
 
 ;; index types must be valid for pointer type
 ;%geperr2 = global sbyte* getelementptr([11x sbyte]* %somestr, ubyte 0)
-;%geperr3 = global sbyte* getelementptr([11x sbyte]* %somestr, uint 0, uint 0, uint 3)
+;%geperr3 = global sbyte* getelementptr([11x sbyte]* %somestr, long 0, long 0, long 3)
 
 ;; element accessed by index list must match return type
 ;%geperr4 = global sbyte* getelementptr([11x sbyte]* %somestr)
-;%geperr5 = global sbyte* getelementptr([11x sbyte]* %somestr, uint 0)
-;%geperr6 = global int* getelementptr([11x sbyte]* %somestr, uint 0, uint 0)
+;%geperr5 = global sbyte* getelementptr([11x sbyte]* %somestr, long 0)
+;%geperr6 = global int* getelementptr([11x sbyte]* %somestr, long 0, long 0)
 
 ;; Cannot use cast expression in pointer field of getelementptr
 ;; (unlike the index fields, where it is legal)
-;%geperr7 = constant int* getelementptr (int* cast long 0, uint 27)
+;%geperr7 = constant int* getelementptr (int* cast long 0, long 27)
 
 


Index: llvm/test/Feature/forwardreftest.ll
diff -u llvm/test/Feature/forwardreftest.ll:1.4 llvm/test/Feature/forwardreftest.ll:1.5
--- llvm/test/Feature/forwardreftest.ll:1.4	Thu May  2 16:52:35 2002
+++ llvm/test/Feature/forwardreftest.ll	Sun Oct  6 17:43:49 2002
@@ -7,22 +7,23 @@
   %thisfuncty = type int (int) *
 implementation
 
+declare void %F(%thisfuncty, %thisfuncty, %thisfuncty)
+
 ; This function always returns zero
-int "zarro"(int %Func)
+int %zarro(int %Func)
 begin
 Startup:
     add int 0, 10
     ret int 0 
 end
 
-int "test"(int) 
+int %test(int) 
 begin
-    add %thisfuncty %zarro, %test
-    add %thisfuncty %test, %foozball
+    call void %F(%thisfuncty %zarro, %thisfuncty %test, %thisfuncty %foozball)
     ret int 0
 end
 
-int "foozball"(int)
+int %foozball(int)
 begin
     ret int 0
 end


Index: llvm/test/Feature/recursivetype.ll
diff -u llvm/test/Feature/recursivetype.ll:1.3 llvm/test/Feature/recursivetype.ll:1.4
--- llvm/test/Feature/recursivetype.ll:1.3	Thu Aug 22 11:04:02 2002
+++ llvm/test/Feature/recursivetype.ll	Sun Oct  6 17:43:49 2002
@@ -63,8 +63,9 @@
         %cast1006 = cast %list** %reg119 to sbyte**             ;;<sbyte**>
         %reg111 = call sbyte* %malloc(uint 16)                  ;;<sbyte*>
         store sbyte* %reg111, sbyte** %cast1006                 ;;<void>
-        %cast1007 = cast ulong 8 to sbyte*                      ;;<sbyte*>
-        %reg1002 = add sbyte* %reg111, %cast1007                ;;<sbyte*>
+	%reg111 = cast sbyte* %reg111 to ulong
+	%reg1002 = add ulong %reg111, 8
+        %reg1002 = cast ulong %reg1002 to sbyte*             ;;<sbyte*>
         %cast1008 = cast sbyte* %reg1002 to int*                ;;<int*>
         store int %Data, int* %cast1008                         ;;<void>
         %cast1003 = cast ulong 0 to ulong*                      ;;<ulong*>
@@ -88,7 +89,7 @@
         ret %list* null
 
 bb4:
-	%idx = getelementptr %list* %reg115, uint 0, ubyte 1                  ;;<int>
+	%idx = getelementptr %list* %reg115, long 0, ubyte 1                  ;;<int>
         %reg111 = load int* %idx
         %cond1013 = setne int %reg111, %Data                    ;;<bool>
         br bool %cond1013, label %bb6, label %bb5
@@ -97,7 +98,7 @@
         ret %list* %reg115
 
 bb6:
-	%idx2 = getelementptr %list* %reg115, uint 0, ubyte 0                  ;;<%list*>
+	%idx2 = getelementptr %list* %reg115, long 0, ubyte 0                  ;;<%list*>
         %reg116 = load %list** %idx2
         br label %bb2
 end


Index: llvm/test/Feature/testalloca.ll
diff -u llvm/test/Feature/testalloca.ll:1.4 llvm/test/Feature/testalloca.ll:1.5
--- llvm/test/Feature/testalloca.ll:1.4	Thu Aug 22 11:04:03 2002
+++ llvm/test/Feature/testalloca.ll	Sun Oct  6 17:43:49 2002
@@ -11,12 +11,12 @@
     %val = load int* %ptr                   ; yields {int}:val = int %3
 
     %sptr = alloca %struct                  ; yields {%struct*}:sptr
-    %nsptr = getelementptr %struct * %sptr, uint 0, ubyte 1  ; yields {inners*}:nsptr
-    %ubsptr = getelementptr %inners * %nsptr, uint 0, ubyte 1  ; yields {{ubyte}*}:ubsptr
-    %idx = getelementptr {ubyte} * %ubsptr, uint 0, ubyte 0
+    %nsptr = getelementptr %struct * %sptr, long 0, ubyte 1  ; yields {inners*}:nsptr
+    %ubsptr = getelementptr %inners * %nsptr, long 0, ubyte 1  ; yields {{ubyte}*}:ubsptr
+    %idx = getelementptr {ubyte} * %ubsptr, long 0, ubyte 0
     store ubyte 4, ubyte* %idx
     
-    %fptr = getelementptr %struct * %sptr, uint 0, ubyte 1, ubyte 0  ; yields {float*}:fptr
+    %fptr = getelementptr %struct * %sptr, long 0, ubyte 1, ubyte 0  ; yields {float*}:fptr
     store float 4.0, float * %fptr
     
     ret int 3


Index: llvm/test/Feature/testconstants.ll
diff -u llvm/test/Feature/testconstants.ll:1.4 llvm/test/Feature/testconstants.ll:1.5
--- llvm/test/Feature/testconstants.ll:1.4	Wed May 22 17:28:27 2002
+++ llvm/test/Feature/testconstants.ll	Sun Oct  6 17:43:49 2002
@@ -11,7 +11,7 @@
 
 sbyte* %otherfunc(int, double)
 begin
-	%somestr = getelementptr [11x sbyte]* %somestr, uint 0, uint 0
+	%somestr = getelementptr [11x sbyte]* %somestr, long 0, long 0
 	ret sbyte* %somestr
 end
 


Index: llvm/test/Feature/testmemory.ll
diff -u llvm/test/Feature/testmemory.ll:1.5 llvm/test/Feature/testmemory.ll:1.6
--- llvm/test/Feature/testmemory.ll:1.5	Thu Aug 22 11:04:03 2002
+++ llvm/test/Feature/testmemory.ll	Sun Oct  6 17:43:49 2002
@@ -5,18 +5,18 @@
 
 int "main"()
 begin
-  call int %testfunction(uint 0, uint 1)
+  call int %testfunction(long 0, long 1)
   ret int 0
 end
 
-int "testfunction"(uint %i0, uint %j0)
+int "testfunction"(long %i0, long %j0)
 begin
     %array0 = malloc [4 x ubyte]            ; yields {[4 x ubyte]*}:array0
     %size   = add uint 2, 2                 ; yields {uint}:size = uint %4
     %array1 = malloc ubyte, uint 4          ; yields {ubyte*}:array1
     %array2 = malloc ubyte, uint %size      ; yields {ubyte*}:array2
 
-    %idx = getelementptr [4 x ubyte]* %array0, uint 0, uint 2
+    %idx = getelementptr [4 x ubyte]* %array0, long 0, long 2
     store ubyte 123, ubyte* %idx
     free [4x ubyte]* %array0
     free ubyte* %array1
@@ -24,7 +24,7 @@
 
 
     %aa = alloca %complexty, uint 5
-    %idx2 = getelementptr %complexty* %aa, uint %i0, ubyte 1, ubyte 0, uint %j0
+    %idx2 = getelementptr %complexty* %aa, long %i0, ubyte 1, ubyte 0, long %j0
     store sbyte *null, sbyte** %idx2
     
     %ptr = alloca int                       ; yields {int*}:ptr
@@ -32,8 +32,8 @@
     %val = load int* %ptr                   ; yields {int}:val = int %3
 
     %sptr = alloca %struct                  ; yields {%struct*}:sptr
-    %ubsptr = getelementptr %struct * %sptr, uint 0, ubyte 1, ubyte 1  ; yields {{ubyte}*}:ubsptr
-    %idx3 = getelementptr {ubyte} * %ubsptr, uint 0, ubyte 0
+    %ubsptr = getelementptr %struct * %sptr, long 0, ubyte 1, ubyte 1  ; yields {{ubyte}*}:ubsptr
+    %idx3 = getelementptr {ubyte} * %ubsptr, long 0, ubyte 0
     store ubyte 4, ubyte* %idx3
 
     ret int 3





More information about the llvm-commits mailing list