diff options
| author | Dan Gohman <djg@cray.com> | 2007-07-18 16:29:46 +0000 |
|---|---|---|
| committer | Dan Gohman <djg@cray.com> | 2007-07-18 16:29:46 +0000 |
| commit | f17a25c88b892d30c2b41ba7ecdfbdfb2b4be9cc (patch) | |
| tree | ebb79ea1ee5e3bc1fdf38541a811a8b804f0679a /test/CodeGen/Generic/GC | |
| download | external_llvm-f17a25c88b892d30c2b41ba7ecdfbdfb2b4be9cc.zip external_llvm-f17a25c88b892d30c2b41ba7ecdfbdfb2b4be9cc.tar.gz external_llvm-f17a25c88b892d30c2b41ba7ecdfbdfb2b4be9cc.tar.bz2 | |
It's not necessary to do rounding for alloca operations when the requested
alignment is equal to the stack alignment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40004 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/Generic/GC')
| -rw-r--r-- | test/CodeGen/Generic/GC/alloc_loop.ll | 54 | ||||
| -rw-r--r-- | test/CodeGen/Generic/GC/dg.exp | 3 |
2 files changed, 57 insertions, 0 deletions
diff --git a/test/CodeGen/Generic/GC/alloc_loop.ll b/test/CodeGen/Generic/GC/alloc_loop.ll new file mode 100644 index 0000000..11294e1 --- /dev/null +++ b/test/CodeGen/Generic/GC/alloc_loop.ll @@ -0,0 +1,54 @@ +; RUN: llvm-upgrade < %s | llvm-as | llc + +implementation + +declare sbyte* %llvm_gc_allocate(uint) +declare void %llvm_gc_initialize(uint) + +declare void %llvm.gcroot(sbyte**, sbyte*) +declare void %llvm.gcwrite(sbyte*, sbyte*, sbyte**) + +int %main() { +entry: + %A = alloca sbyte* + %B = alloca sbyte** + + call void %llvm_gc_initialize(uint 1048576) ; Start with 1MB heap + + ;; void *A; + call void %llvm.gcroot(sbyte** %A, sbyte* null) + + ;; A = gcalloc(10); + %Aptr = call sbyte* %llvm_gc_allocate(uint 10) + store sbyte* %Aptr, sbyte** %A + + ;; void **B; + %tmp.1 = cast sbyte*** %B to sbyte ** + call void %llvm.gcroot(sbyte** %tmp.1, sbyte* null) + + ;; B = gcalloc(4); + %B = call sbyte* %llvm_gc_allocate(uint 8) + %tmp.2 = cast sbyte* %B to sbyte** + store sbyte** %tmp.2, sbyte*** %B + + ;; *B = A; + %B.1 = load sbyte*** %B + %A.1 = load sbyte** %A + call void %llvm.gcwrite(sbyte* %A.1, sbyte* %B, sbyte** %B.1) + + br label %AllocLoop + +AllocLoop: + %i = phi uint [ 0, %entry ], [ %indvar.next, %AllocLoop ] + ;; Allocated mem: allocated memory is immediately dead. + call sbyte* %llvm_gc_allocate(uint 100) + + %indvar.next = add uint %i, 1 + %exitcond = seteq uint %indvar.next, 10000000 + br bool %exitcond, label %Exit, label %AllocLoop + +Exit: + ret int 0 +} + +declare void %__main() diff --git a/test/CodeGen/Generic/GC/dg.exp b/test/CodeGen/Generic/GC/dg.exp new file mode 100644 index 0000000..879685c --- /dev/null +++ b/test/CodeGen/Generic/GC/dg.exp @@ -0,0 +1,3 @@ +load_lib llvm.exp + +RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]] |
