diff options
author | Evan Cheng <evan.cheng@apple.com> | 2010-03-05 20:47:23 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2010-03-05 20:47:23 +0000 |
commit | fffdad58ac5b503570767d62509254a268709ebb (patch) | |
tree | 50d279062aa1ddc8cb978d6692b3b5ac30cbd679 /llvm/test/Transforms | |
parent | b2bc4b9880e08a23d52faa05bab88f9d8da65711 (diff) | |
download | bcm5719-llvm-fffdad58ac5b503570767d62509254a268709ebb.tar.gz bcm5719-llvm-fffdad58ac5b503570767d62509254a268709ebb.zip |
Instcombine should turn llvm.objectsize of a alloca with static size to an integer.
llvm-svn: 97827
Diffstat (limited to 'llvm/test/Transforms')
-rw-r--r-- | llvm/test/Transforms/InstCombine/objsize.ll | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/objsize.ll b/llvm/test/Transforms/InstCombine/objsize.ll index 9df122499e6..bf1a37f975d 100644 --- a/llvm/test/Transforms/InstCombine/objsize.ll +++ b/llvm/test/Transforms/InstCombine/objsize.ll @@ -102,4 +102,24 @@ bb12: unreachable } +; rdar://7718857 + +%struct.data = type { [100 x i32], [100 x i32], [1024 x i8] } + +define i32 @test4() nounwind ssp { +; CHECK: @test4 +entry: + %0 = alloca %struct.data, align 8 + %1 = bitcast %struct.data* %0 to i8* + %2 = call i64 @llvm.objectsize.i64(i8* %1, i1 false) nounwind +; CHECK-NOT: @llvm.objectsize +; CHECK: @__memset_chk(i8* %1, i32 0, i64 1824, i64 1824) + %3 = call i8* @__memset_chk(i8* %1, i32 0, i64 1824, i64 %2) nounwind + ret i32 0 +} + +declare i8* @__memset_chk(i8*, i32, i64, i64) nounwind + declare i32 @llvm.objectsize.i32(i8*, i1) nounwind readonly + +declare i64 @llvm.objectsize.i64(i8*, i1) nounwind readonly |