3 declare sbyte* %llvm_gc_allocate(uint)
4 declare void %llvm_gc_initialize(uint)
6 declare void %llvm.gcroot(sbyte**, sbyte*)
7 declare void %llvm.gcwrite(sbyte*, sbyte*, sbyte**)
14 call void %llvm_gc_initialize(uint 1048576) ; Start with 1MB heap
17 call void %llvm.gcroot(sbyte** %A, sbyte* null)
20 %Aptr = call sbyte* %llvm_gc_allocate(uint 10)
21 store sbyte* %Aptr, sbyte** %A
24 %tmp.1 = cast sbyte*** %B to sbyte **
25 call void %llvm.gcroot(sbyte** %tmp.1, sbyte* null)
28 %B = call sbyte* %llvm_gc_allocate(uint 8)
29 %tmp.2 = cast sbyte* %B to sbyte**
30 store sbyte** %tmp.2, sbyte*** %B
33 %B.1 = load sbyte*** %B
34 %A.1 = load sbyte** %A
35 call void %llvm.gcwrite(sbyte* %A.1, sbyte* %B, sbyte** %B.1)
40 %i = phi uint [ 0, %entry ], [ %indvar.next, %AllocLoop ]
41 ;; Allocated mem: allocated memory is immediately dead.
42 call sbyte* %llvm_gc_allocate(uint 100)
44 %indvar.next = add uint %i, 1
45 %exitcond = seteq uint %indvar.next, 10000000
46 br bool %exitcond, label %Exit, label %AllocLoop
52 declare void %__main()