diff options
author | Nuno Lopes <nunoplopes@sapo.pt> | 2012-05-09 21:30:57 +0000 |
---|---|---|
committer | Nuno Lopes <nunoplopes@sapo.pt> | 2012-05-09 21:30:57 +0000 |
commit | e3305b17502c2a34152d4f50607b685eb2cadd21 (patch) | |
tree | 9d967693ab42208f175ccc564e4242d7b81290bc /test/Transforms/InstCombine/objsize.ll | |
parent | 9166d23327c8dfb5b600795715e75e8b446b5690 (diff) | |
download | llvm-e3305b17502c2a34152d4f50607b685eb2cadd21.tar.gz llvm-e3305b17502c2a34152d4f50607b685eb2cadd21.tar.bz2 llvm-e3305b17502c2a34152d4f50607b685eb2cadd21.tar.xz |
objectsize:
refactor code a bit to enable future changes to support run-time information
add support to compute allocation sizes at run-time if penalty > 1 (e.g., malloc(x), calloc(x, y), and VLAs)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156515 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine/objsize.ll')
-rw-r--r-- | test/Transforms/InstCombine/objsize.ll | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/test/Transforms/InstCombine/objsize.ll b/test/Transforms/InstCombine/objsize.ll index 522e25f6f3..524a28f614 100644 --- a/test/Transforms/InstCombine/objsize.ll +++ b/test/Transforms/InstCombine/objsize.ll @@ -42,7 +42,7 @@ define i32 @f() nounwind { define i1 @baz() nounwind { ; CHECK: @baz -; CHECK-NEXT: ret i1 true +; CHECK-NEXT: objectsize %1 = tail call i32 @llvm.objectsize.i32(i8* getelementptr inbounds ([0 x i8]* @window, i32 0, i32 0), i1 false, i32 0) %2 = icmp eq i32 %1, -1 ret i1 %2 @@ -168,13 +168,3 @@ define i32 @test8() { ; CHECK-NEXT: ret i32 30 ret i32 %objsize } - -; test for overflow in calloc -define i32 @test9() { -; CHECK: @test9 - %alloc = call noalias i8* @calloc(i32 100000000, i32 100000000) nounwind - %gep = getelementptr inbounds i8* %alloc, i32 2 - %objsize = call i32 @llvm.objectsize.i32(i8* %gep, i1 true, i32 0) nounwind readonly -; CHECK-NEXT: ret i32 0 - ret i32 %objsize -} |