When removing a function from the function set and adding it to deferred, we
[llvm.git] / test / Integer / testmemory_bt.ll
blobe503c56a33e687f94cfba053b5fed3e31a48ad8c
1 ; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
2 ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
3 ; RUN: diff %t1.ll %t2.ll
6 %struct = type { i31 , {float, {i9 } } , i64 }
7 %complexty = type {i31, {[4 x i9 *], float}, double}
10 define i31 @"main"()
11 begin
12   call i31 @testfunction(i64 0, i64 1)
13   ret i31 0
14 end
16 define i31 @"testfunction"(i64 %i0, i64 %j0)
17 begin
18     %array0 = malloc [4 x i9]            ; yields {[4 x i9]*}:array0
19     %size   = add i32 2, 2                 ; yields {i31}:size = i31 %4
20     %array1 = malloc i9, i32 4          ; yields {i9*}:array1
21     %array2 = malloc i9, i32 %size      ; yields {i9*}:array2
23     %idx = getelementptr [4 x i9]* %array0, i64 0, i64 2
24     store i9 123, i9* %idx
25     free [4x i9]* %array0
26     free i9* %array1
27     free i9* %array2
30     %aa = alloca %complexty, i32 5
31     %idx2 = getelementptr %complexty* %aa, i64 %i0, i32 1, i32 0, i64 %j0
32     store i9 *null, i9** %idx2
33     
34     %ptr = alloca i31                       ; yields {i31*}:ptr
35     store i31 3, i31* %ptr                  ; yields {void}
36     %val = load i31* %ptr                   ; yields {i31}:val = i31 %3
38     %sptr = alloca %struct                  ; yields {%struct*}:sptr
39     %ubsptr = getelementptr %struct * %sptr, i64 0, i32 1, i32 1  ; yields {{i9}*}:ubsptr
40     %idx3 = getelementptr {i9} * %ubsptr, i64 0, i32 0
41     store i9 4, i9* %idx3
43     ret i31 3
44 end