Initial checkin
[oota-llvm.git] / test / Feature / testalloca.ll
1 %inners = type {float, {ubyte } }
2 %struct = type { int , {float, {ubyte } } , ulong }
3
4 implementation
5
6 int %testfunction(int %i0, int %j0)
7 begin
8     alloca ubyte, uint 5
9     %ptr = alloca int                       ; yields {int*}:ptr
10     store int 3, int* %ptr                  ; yields {void}
11     %val = load int* %ptr                   ; yields {int}:val = int %3
12
13     %sptr = alloca %struct                  ; yields {%struct*}:sptr
14     %nsptr = getelementptr %struct * %sptr, long 0, ubyte 1  ; yields {inners*}:nsptr
15     %ubsptr = getelementptr %inners * %nsptr, long 0, ubyte 1  ; yields {{ubyte}*}:ubsptr
16     %idx = getelementptr {ubyte} * %ubsptr, long 0, ubyte 0
17     store ubyte 4, ubyte* %idx
18     
19     %fptr = getelementptr %struct * %sptr, long 0, ubyte 1, ubyte 0  ; yields {float*}:fptr
20     store float 4.0, float * %fptr
21     
22     ret int 3
23 end
24