- Cleaned up all of the test/Feature tests to not use uint's with
authorChris Lattner <sabre@nondot.org>
Sun, 6 Oct 2002 22:43:49 +0000 (22:43 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 6 Oct 2002 22:43:49 +0000 (22:43 +0000)
    getelementptr instructions and not to add pointers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4049 91177308-0d34-0410-b5e6-96231b3b80d8

test/Feature/constexpr.ll
test/Feature/constexprbad.ll
test/Feature/forwardreftest.ll
test/Feature/recursivetype.ll
test/Feature/testalloca.ll
test/Feature/testconstants.ll
test/Feature/testmemory.ll

index a107241e2969bd84c6e21924942c7a061e5d9f38..9e67b1f4738ce5b59ce7a736f09c47fbd16e80c2 100644 (file)
@@ -25,17 +25,17 @@ global float 0.0
 ;;---------------------------------------------------
 
 %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 @@ global float 0.0
 %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 @@ global float 0.0
 
 %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 592e1ca349ade6c163267b56a56259f82068d900..cbec98a417e309a57c057b2bd736497a9575116d 100644 (file)
 ;;---------------------------------------------------
 
 ;; 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 5b62989c637e314792c1a7efaa62d72f6d05a313..641aff5ad756258f7f037e1046b6d38d4764faa6 100644 (file)
@@ -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 9e16e2c360e2d4182e1d80a84b9c7cbd9aed578b..13a2094d3f311a1a53ed78b54ac8b4946b10fc05 100644 (file)
@@ -63,8 +63,9 @@ bb3:
         %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 @@ bb3:
         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 @@ bb5:
         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 cf54743dc70282923031d591c713cf2bf07dd826..d6af922db5ac944d6a022b9fae7d47f05aa84a6c 100644 (file)
@@ -11,12 +11,12 @@ begin
     %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 0ef48e50bb6401cc75a9e68905ee842f42939188..df525f51f3608cf28e2d66c7537abeb7cb21311e 100644 (file)
@@ -11,7 +11,7 @@ end
 
 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 f46dca1bb221e8556f6fd9149de682d1851d97f2..fca4532fae130f32c45af36f79dd0d71d3f86a47 100644 (file)
@@ -5,18 +5,18 @@ implementation
 
 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 @@ begin
 
 
     %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 @@ begin
     %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