Use the llvm-upgrade program to upgrade llvm assembly.
[oota-llvm.git] / test / Feature / testalloca.ll
index 9e074ced9083fcf69a2f82d3f445b0c689ccef3d..d05b70d0c30be904b5f86a2a930a232c7728a03d 100644 (file)
@@ -1,3 +1,7 @@
+; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > %t1.ll
+; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
+; RUN: diff %t1.ll %t2.ll
+
 %inners = type {float, {ubyte } }
 %struct = type { int , {float, {ubyte } } , ulong }
 
@@ -11,11 +15,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
-    store ubyte 4, {ubyte} * %ubsptr, uint 0, ubyte 0
+    %nsptr = getelementptr %struct * %sptr, long 0, uint 1  ; yields {inners*}:nsptr
+    %ubsptr = getelementptr %inners * %nsptr, long 0, uint 1  ; yields {{ubyte}*}:ubsptr
+    %idx = getelementptr {ubyte} * %ubsptr, long 0, uint 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, uint 1, uint 0  ; yields {float*}:fptr
     store float 4.0, float * %fptr
     
     ret int 3