1 ; RUN: llvm-upgrade < %s | llvm-as | llc
5 declare sbyte* %llvm_gc_allocate(uint)
6 declare void %llvm_gc_initialize(uint)
8 declare void %llvm.gcroot(sbyte**, sbyte*)
9 declare void %llvm.gcwrite(sbyte*, sbyte*, sbyte**)
16 call void %llvm_gc_initialize(uint 1048576) ; Start with 1MB heap
19 call void %llvm.gcroot(sbyte** %A, sbyte* null)
22 %Aptr = call sbyte* %llvm_gc_allocate(uint 10)
23 store sbyte* %Aptr, sbyte** %A
26 %tmp.1 = cast sbyte*** %B to sbyte **
27 call void %llvm.gcroot(sbyte** %tmp.1, sbyte* null)
30 %B = call sbyte* %llvm_gc_allocate(uint 8)
31 %tmp.2 = cast sbyte* %B to sbyte**
32 store sbyte** %tmp.2, sbyte*** %B
35 %B.1 = load sbyte*** %B
36 %A.1 = load sbyte** %A
37 call void %llvm.gcwrite(sbyte* %A.1, sbyte* %B, sbyte** %B.1)
42 %i = phi uint [ 0, %entry ], [ %indvar.next, %AllocLoop ]
43 ;; Allocated mem: allocated memory is immediately dead.
44 call sbyte* %llvm_gc_allocate(uint 100)
46 %indvar.next = add uint %i, 1
47 %exitcond = seteq uint %indvar.next, 10000000
48 br bool %exitcond, label %Exit, label %AllocLoop
54 declare void %__main()