Skip to content

Commit 0bd0d72

Browse files
committed
[InstCombine] Add test for zext nneg miscompile (NFC)
Exposed by #71534 and reported there.
1 parent c51a896 commit 0bd0d72

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

llvm/test/Transforms/InstCombine/assoc-cast-assoc.ll

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,13 @@ define <2 x i32> @AndZextAndVec(<2 x i8> %a) {
7575
ret <2 x i32> %op2
7676
}
7777

78+
define i24 @zext_nneg(i16 %a) {
79+
; CHECK-LABEL: @zext_nneg(
80+
; CHECK-NEXT: [[RESIZE:%.*]] = zext nneg i16 [[A:%.*]] to i24
81+
; CHECK-NEXT: ret i24 [[RESIZE]]
82+
;
83+
%and1 = and i16 %a, 32767
84+
%resize = zext nneg i16 %and1 to i24
85+
%and2 = and i24 %resize, 8388607
86+
ret i24 %and2
87+
}

0 commit comments

Comments
 (0)