diff options
author | rdivacky <rdivacky@FreeBSD.org> | 2010-07-13 17:19:57 +0000 |
---|---|---|
committer | rdivacky <rdivacky@FreeBSD.org> | 2010-07-13 17:19:57 +0000 |
commit | 9112829d76cbb8e0c8ef51bbc2d7d1be48cd7b74 (patch) | |
tree | 9de1c5f67a98cd0e73c60838396486c984f63ac2 /test/Transforms/InstCombine/malloc-free-delete.ll | |
parent | 1e3dec662ea18131c495db50caccc57f77b7a5fe (diff) | |
download | FreeBSD-src-9112829d76cbb8e0c8ef51bbc2d7d1be48cd7b74.zip FreeBSD-src-9112829d76cbb8e0c8ef51bbc2d7d1be48cd7b74.tar.gz |
Update LLVM to r108243.
Diffstat (limited to 'test/Transforms/InstCombine/malloc-free-delete.ll')
-rw-r--r-- | test/Transforms/InstCombine/malloc-free-delete.ll | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/test/Transforms/InstCombine/malloc-free-delete.ll b/test/Transforms/InstCombine/malloc-free-delete.ll index a4b7496..317786f 100644 --- a/test/Transforms/InstCombine/malloc-free-delete.ll +++ b/test/Transforms/InstCombine/malloc-free-delete.ll @@ -1,13 +1,25 @@ -; RUN: opt < %s -instcombine -globaldce -S | FileCheck %s +; RUN: opt < %s -instcombine -S | FileCheck %s ; PR1201 define i32 @main(i32 %argc, i8** %argv) { - %c_19 = alloca i8* ; <i8**> [#uses=2] - %malloc_206 = malloc i8, i32 10 ; <i8*> [#uses=1] + %c_19 = alloca i8* + %malloc_206 = malloc i8, i32 10 ; CHECK-NOT: malloc store i8* %malloc_206, i8** %c_19 - %tmp_207 = load i8** %c_19 ; <i8*> [#uses=1] + %tmp_207 = load i8** %c_19 free i8* %tmp_207 ; CHECK-NOT: free ret i32 0 ; CHECK: ret i32 0 } + +declare i8* @malloc(i32) +declare void @free(i8*) + +define i1 @foo() { +; CHECK: @foo +; CHECK-NEXT: ret i1 false + %m = call i8* @malloc(i32 1) + %z = icmp eq i8* %m, null + call void @free(i8* %m) + ret i1 %z +} |