Skip to content

Commit

Permalink
[instsimplify] Precommit a test showing an alloca equality miscompile
Browse files Browse the repository at this point in the history
  • Loading branch information
preames committed Feb 17, 2022
1 parent ca78312 commit 7eb3ce9
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions llvm/test/Transforms/InstSimplify/compare.ll
Expand Up @@ -2700,4 +2700,26 @@ define <2 x i1> @cttz_slt_bitwidth_splat(<2 x i13> %x) {
ret <2 x i1> %cmp
}

; FIXME: A zero sized alloca *can* be equal to another alloca
define i1 @zero_sized_alloca1() {
; CHECK-LABEL: @zero_sized_alloca1(
; CHECK-NEXT: ret i1 true
;
%a = alloca i32, i32 0
%b = alloca i32, i32 0
%res = icmp ne i32* %a, %b
ret i1 %res
}

define i1 @zero_sized_alloca2() {
; CHECK-LABEL: @zero_sized_alloca2(
; CHECK-NEXT: ret i1 true
;
%a = alloca i32, i32 0
%b = alloca i32
%res = icmp ne i32* %a, %b
ret i1 %res
}


attributes #0 = { null_pointer_is_valid }

0 comments on commit 7eb3ce9

Please sign in to comment.