summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Bolvansky <david.bolvansky@gmail.com>2019-08-28 16:00:15 +0000
committerDavid Bolvansky <david.bolvansky@gmail.com>2019-08-28 16:00:15 +0000
commit420327269e238b26148e0304682340195ee9a23b (patch)
treea2809b7d02d4809970538dabad057aba0b4d3411
parentf79d8a064ce4d8846377e4abbc9a389b62f90d43 (diff)
downloadbcm5719-llvm-420327269e238b26148e0304682340195ee9a23b.tar.gz
bcm5719-llvm-420327269e238b26148e0304682340195ee9a23b.zip
[NFC] Added more tests for D66651
llvm-svn: 370222
-rw-r--r--llvm/test/Transforms/InstCombine/deref-alloc-fns.ll18
1 files changed, 18 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/deref-alloc-fns.ll b/llvm/test/Transforms/InstCombine/deref-alloc-fns.ll
index b9e73f5ef17..794d811cdca 100644
--- a/llvm/test/Transforms/InstCombine/deref-alloc-fns.ll
+++ b/llvm/test/Transforms/InstCombine/deref-alloc-fns.ll
@@ -134,6 +134,24 @@ define noalias i8* @calloc_constant_zero_size3(i64 %n) {
ret i8* %call
}
+define noalias i8* @calloc_constant_zero_size4(i64 %n) {
+; CHECK-LABEL: @calloc_constant_zero_size4(
+; CHECK-NEXT: [[CALL:%.*]] = tail call noalias i8* @calloc(i64 0, i64 1)
+; CHECK-NEXT: ret i8* [[CALL]]
+;
+ %call = tail call noalias i8* @calloc(i64 0, i64 1)
+ ret i8* %call
+}
+
+define noalias i8* @calloc_constant_zero_size5(i64 %n) {
+; CHECK-LABEL: @calloc_constant_zero_size5(
+; CHECK-NEXT: [[CALL:%.*]] = tail call noalias i8* @calloc(i64 1, i64 0)
+; CHECK-NEXT: ret i8* [[CALL]]
+;
+ %call = tail call noalias i8* @calloc(i64 1, i64 0)
+ ret i8* %call
+}
+
define noalias i8* @calloc_constant_size() {
; CHECK-LABEL: @calloc_constant_size(
; CHECK-NEXT: [[CALL:%.*]] = tail call noalias dereferenceable_or_null(128) i8* @calloc(i64 16, i64 8)
OpenPOWER on IntegriCloud