Skip to content

Commit 4d3284c

Browse files
committed
[ConstFold] Add test for incorrect gep inbounds of undef fold (NFC)
If the offset is zero, then returning poison here is not correct.
1 parent 8a395b0 commit 4d3284c

File tree

1 file changed

+2
-2
lines changed
  • llvm/test/Transforms/InstSimplify/ConstProp

1 file changed

+2
-2
lines changed

llvm/test/Transforms/InstSimplify/ConstProp/poison.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,14 @@ define void @vec_aggr_ops() {
104104

105105
define void @other_ops(i8 %x) {
106106
; CHECK-LABEL: @other_ops(
107-
; CHECK-NEXT: call void (...) @use(i1 poison, i1 poison, i8 poison, i8 poison, ptr poison, ptr poison)
107+
; CHECK-NEXT: call void (...) @use(i1 poison, i1 poison, i8 poison, i8 poison, ptr poison, ptr poison, ptr poison)
108108
; CHECK-NEXT: ret void
109109
;
110110
%i1 = icmp eq i8 poison, 1
111111
%i2 = fcmp oeq float poison, 1.0
112112
%i3 = select i1 poison, i8 1, i8 2
113113
%i4 = select i1 true, i8 poison, i8 %x
114-
call void (...) @use(i1 %i1, i1 %i2, i8 %i3, i8 %i4, ptr getelementptr (i8, ptr poison, i64 1), ptr getelementptr inbounds (i8, ptr undef, i64 1))
114+
call void (...) @use(i1 %i1, i1 %i2, i8 %i3, i8 %i4, ptr getelementptr (i8, ptr poison, i64 1), ptr getelementptr inbounds (i8, ptr undef, i64 0), ptr getelementptr inbounds (i8, ptr undef, i64 1))
115115
ret void
116116
}
117117

0 commit comments

Comments
 (0)