Vikram S. Adve | 18f60c7 | 2001-07-21 12:46:12 +0000 | [diff] [blame] | 1 | %inners = type {float, {ubyte } } |
| 2 | %struct = type { int , {float, {ubyte } } , ulong } |
| 3 | |
| 4 | implementation |
| 5 | |
| 6 | int "test function"(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, 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 |
| 22 | end |
| 23 | |