summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorNuno Lopes <nunoplopes@sapo.pt>2012-05-09 21:30:57 +0000
committerNuno Lopes <nunoplopes@sapo.pt>2012-05-09 21:30:57 +0000
commit7100f463b0670377c8a29d88becff5a60dc151bd (patch)
tree301c48540db8f5f074c7a0ba7fc6b561c95ea702 /llvm/test
parent26e184d4e4d4b5fca2667ec4ed444013b770de2c (diff)
downloadbcm5719-llvm-7100f463b0670377c8a29d88becff5a60dc151bd.tar.gz
bcm5719-llvm-7100f463b0670377c8a29d88becff5a60dc151bd.zip
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) llvm-svn: 156515
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Transforms/InstCombine/objsize.ll12
1 files changed, 1 insertions, 11 deletions
diff --git a/llvm/test/Transforms/InstCombine/objsize.ll b/llvm/test/Transforms/InstCombine/objsize.ll
index 522e25f6f33..524a28f614b 100644
--- a/llvm/test/Transforms/InstCombine/objsize.ll
+++ b/llvm/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
-}
OpenPOWER on IntegriCloud