From e3305b17502c2a34152d4f50607b685eb2cadd21 Mon Sep 17 00:00:00 2001 From: Nuno Lopes Date: Wed, 9 May 2012 21:30:57 +0000 Subject: 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 --- test/Transforms/InstCombine/objsize.ll | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'test/Transforms/InstCombine/objsize.ll') 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 -} -- cgit v1.2.3