Skip to content

Commit 21cc740

Browse files
committed
[ConstraintElim] Add extra test with chained GEPs without inbounds.
1 parent 34e477e commit 21cc740

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

llvm/test/Transforms/ConstraintElimination/gep-chains.ll

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,3 +371,19 @@ define i1 @gep_add_1_ult_var_idx_no_inbounds(ptr %dst, ptr %upper, i8 %len, i8 %
371371
%res.2 = xor i1 %res.1, %cmp.idx.3
372372
ret i1 %res.2
373373
}
374+
375+
define i1 @test_chained_no_inbounds(ptr %A, ptr %B) {
376+
entry:
377+
%B.1 = getelementptr i8, ptr %B, i64 1
378+
%B.2 = getelementptr i8, ptr %B.1, i64 1
379+
%c.1 = icmp ugt ptr %A, null
380+
%c.2 = icmp ugt ptr %B.1, %B.2
381+
%or = or i1 %c.1, %c.2
382+
br i1 %or, label %then, label %else
383+
384+
then:
385+
ret i1 true
386+
387+
else:
388+
ret i1 false
389+
}

0 commit comments

Comments
 (0)