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 | a862326bc72be147d9f668b84b9187258e690dc4 (patch) | |
tree | 28c3ac9aa431703b6851ff32efcedc39371e9cd0 /test/Transforms | |
parent | 10718492c8096bc6779515ef47216715fb749fca (diff) | |
download | external_llvm-a862326bc72be147d9f668b84b9187258e690dc4.zip external_llvm-a862326bc72be147d9f668b84b9187258e690dc4.tar.gz external_llvm-a862326bc72be147d9f668b84b9187258e690dc4.tar.bz2 |
Instcombine should turn llvm.objectsize of a alloca with static size to an integer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97827 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-rw-r--r-- | test/Transforms/InstCombine/objsize.ll | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/objsize.ll b/test/Transforms/InstCombine/objsize.ll index 9df1224..bf1a37f 100644 --- a/test/Transforms/InstCombine/objsize.ll +++ b/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 |