Use unified diffs with gnu diff instead of old diffs
[oota-llvm.git] / test / Feature / testmemory.ll
1 %struct = type { int , {float, {ubyte } } , ulong }
2 %complexty = type {int, {[4 x sbyte *], float}, double}
3
4 implementation
5
6 int "main"()
7 begin
8   call int %testfunction(uint 0, uint 1)
9   ret int 0
10 end
11
12 int "testfunction"(uint %i0, uint %j0)
13 begin
14     %array0 = malloc [4 x ubyte]            ; yields {[4 x ubyte]*}:array0
15     %size   = add uint 2, 2                 ; yields {uint}:size = uint %4
16     %array1 = malloc ubyte, uint 4          ; yields {ubyte*}:array1
17     %array2 = malloc ubyte, uint %size      ; yields {ubyte*}:array2
18
19     store ubyte 123, [4 x ubyte]* %array0, uint 0, uint 2
20     free [4x ubyte]* %array0
21     free ubyte* %array1
22     free ubyte* %array2
23
24
25     %aa = alloca %complexty, uint 5
26     store sbyte *null, %complexty* %aa, uint %i0, ubyte 1, ubyte 0, uint %j0
27     
28     %ptr = alloca int                       ; yields {int*}:ptr
29     store int 3, int* %ptr                  ; yields {void}
30     %val = load int* %ptr                   ; yields {int}:val = int %3
31
32     %sptr = alloca %struct                  ; yields {%struct*}:sptr
33     %ubsptr = getelementptr %struct * %sptr, uint 0, ubyte 1, ubyte 1  ; yields {{ubyte}*}:ubsptr
34     store ubyte 4, {ubyte} * %ubsptr, uint 0, ubyte 0
35
36     ret int 3
37 end
38