Skip to content

Commit 4203272

Browse files
committedAug 28, 2019
[NFC] Added more tests for D66651
llvm-svn: 370222
1 parent f79d8a0 commit 4203272

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
 

Diff for: ‎llvm/test/Transforms/InstCombine/deref-alloc-fns.ll

+18
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,24 @@ define noalias i8* @calloc_constant_zero_size3(i64 %n) {
134134
ret i8* %call
135135
}
136136

137+
define noalias i8* @calloc_constant_zero_size4(i64 %n) {
138+
; CHECK-LABEL: @calloc_constant_zero_size4(
139+
; CHECK-NEXT: [[CALL:%.*]] = tail call noalias i8* @calloc(i64 0, i64 1)
140+
; CHECK-NEXT: ret i8* [[CALL]]
141+
;
142+
%call = tail call noalias i8* @calloc(i64 0, i64 1)
143+
ret i8* %call
144+
}
145+
146+
define noalias i8* @calloc_constant_zero_size5(i64 %n) {
147+
; CHECK-LABEL: @calloc_constant_zero_size5(
148+
; CHECK-NEXT: [[CALL:%.*]] = tail call noalias i8* @calloc(i64 1, i64 0)
149+
; CHECK-NEXT: ret i8* [[CALL]]
150+
;
151+
%call = tail call noalias i8* @calloc(i64 1, i64 0)
152+
ret i8* %call
153+
}
154+
137155
define noalias i8* @calloc_constant_size() {
138156
; CHECK-LABEL: @calloc_constant_size(
139157
; CHECK-NEXT: [[CALL:%.*]] = tail call noalias dereferenceable_or_null(128) i8* @calloc(i64 16, i64 8)

0 commit comments

Comments
 (0)
Please sign in to comment.