blob: d05b70d0c30be904b5f86a2a930a232c7728a03d [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001; RUN: llvm-upgrade < %s | llvm-as | 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
8implementation
9
10int %testfunction(int %i0, int %j0)
11begin
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, uint 1 ; yields {inners*}:nsptr
19 %ubsptr = getelementptr %inners * %nsptr, long 0, uint 1 ; yields {{ubyte}*}:ubsptr
20 %idx = getelementptr {ubyte} * %ubsptr, long 0, uint 0
21 store ubyte 4, ubyte* %idx
22
23 %fptr = getelementptr %struct * %sptr, long 0, uint 1, uint 0 ; yields {float*}:fptr
24 store float 4.0, float * %fptr
25
26 ret int 3
27end
28