Added RUN lines and dejagnu support for Feature dir.
[oota-llvm.git] / test / Feature / testalloca.ll
1 ; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
2 ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
3 ; RUN: diff %t1.ll %t2.ll
4
5 %inners = type {float, {ubyte } }
6 %struct = type { int , {float, {ubyte } } , ulong }
7
8 implementation
9
10 int %testfunction(int %i0, int %j0)
11 begin
12     alloca ubyte, uint 5
13     %ptr = alloca int                       ; yields {int*}:ptr
14     store int 3, int* %ptr                  ; yields {void}
15     %val = load int* %ptr                   ; yields {int}:val = int %3
16
17     %sptr = alloca %struct                  ; yields {%struct*}:sptr
18     %nsptr = getelementptr %struct * %sptr, long 0, ubyte 1  ; yields {inners*}:nsptr
19     %ubsptr = getelementptr %inners * %nsptr, long 0, ubyte 1  ; yields {{ubyte}*}:ubsptr
20     %idx = getelementptr {ubyte} * %ubsptr, long 0, ubyte 0
21     store ubyte 4, ubyte* %idx
22     
23     %fptr = getelementptr %struct * %sptr, long 0, ubyte 1, ubyte 0  ; yields {float*}:fptr
24     store float 4.0, float * %fptr
25     
26     ret int 3
27 end
28