blob: cb867c06bafbac10130f59ac89ea6615d6fc5e6c [file] [log] [blame]
Vikram S. Adve18f60c72001-07-21 12:46:12 +00001%inners = type {float, {ubyte } }
2%struct = type { int , {float, {ubyte } } , ulong }
3
4implementation
5
6int "test function"(int %i0, int %j0)
7begin
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, ubyte 1 ; yields {inners*}:nsptr
15 %ubsptr = getelementptr %inners * %nsptr, ubyte 1 ; yields {{ubyte}*}:ubsptr
16 store ubyte 4, {ubyte} * %ubsptr, ubyte 0
17
18 %fptr = getelementptr %struct * %sptr, ubyte 1, ubyte 0 ; yields {float*}:fptr
19 store float 4.0, float * %fptr
20
21 ret int 3
22end
23