blob: 9b0630aa7fab90bb0468c1ec7710746b6683e67c [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
Chris Lattnereb81d532001-12-14 16:46:53 +00008 alloca ubyte, uint 5
Vikram S. Adve18f60c72001-07-21 12:46:12 +00009 %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
Chris Lattnereb81d532001-12-14 16:46:53 +000014 %nsptr = getelementptr %struct * %sptr, uint 0, ubyte 1 ; yields {inners*}:nsptr
15 %ubsptr = getelementptr %inners * %nsptr, uint 0, ubyte 1 ; yields {{ubyte}*}:ubsptr
16 store ubyte 4, {ubyte} * %ubsptr, uint 0, ubyte 0
Vikram S. Adve18f60c72001-07-21 12:46:12 +000017
Chris Lattnereb81d532001-12-14 16:46:53 +000018 %fptr = getelementptr %struct * %sptr, uint 0, ubyte 1, ubyte 0 ; yields {float*}:fptr
Vikram S. Adve18f60c72001-07-21 12:46:12 +000019 store float 4.0, float * %fptr
20
21 ret int 3
22end
23