Skip to content

Commit 70a1d95

Browse files
committed
adds negative test
1 parent 15c24c6 commit 70a1d95

File tree

1 file changed

+15
-0
lines changed
  • llvm/test/Transforms/InstCombine

1 file changed

+15
-0
lines changed

llvm/test/Transforms/InstCombine/fcmp.ll

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1719,6 +1719,21 @@ define <2 x i1> @fcmp_une_sel_x_negx_with_any_fpzero_nnan_vec(<2 x i1> %cond, <2
17191719
ret <2 x i1> %icmp
17201720
}
17211721

1722+
; negative test - extra use
1723+
1724+
define i1 @fcmp_ueq_fsub_const_extra_use(float %x, float %y) {
1725+
; CHECK-LABEL: @fcmp_ueq_fsub_const_extra_use(
1726+
; CHECK-NEXT: [[FS:%.*]] = fsub float [[X:%.*]], [[Y:%.*]]
1727+
; CHECK-NEXT: call void @use(float [[FS]])
1728+
; CHECK-NEXT: [[CMP:%.*]] = fcmp ueq float [[FS]], 0.000000e+00
1729+
; CHECK-NEXT: ret i1 [[CMP]]
1730+
;
1731+
%fs = fsub float %x, %y
1732+
call void @use(float %fs)
1733+
%cmp = fcmp ueq float %fs, 0.000000e+00
1734+
ret i1 %cmp
1735+
}
1736+
17221737
define i1 @fcmp_oeq_fsub_const(float %x, float %y) {
17231738
; CHECK-LABEL: @fcmp_oeq_fsub_const(
17241739
; CHECK-NEXT: [[FS:%.*]] = fsub float [[X:%.*]], [[Y:%.*]]

0 commit comments

Comments
 (0)