From 36890a399ad708c0c2f186b1eaea5bdff3a9ab5f Mon Sep 17 00:00:00 2001 From: David Bolvansky Date: Wed, 28 Aug 2019 16:00:15 +0000 Subject: [PATCH] [NFC] Added more tests for D66651 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370222 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Transforms/InstCombine/deref-alloc-fns.ll | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/Transforms/InstCombine/deref-alloc-fns.ll b/test/Transforms/InstCombine/deref-alloc-fns.ll index b9e73f5ef17..794d811cdca 100644 --- a/test/Transforms/InstCombine/deref-alloc-fns.ll +++ b/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) -- 2.40.0