Skip to content

Commit f43001f

Browse files
author
Xiang Li
committed
Add test for neg zero.
1 parent 18e9504 commit f43001f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

mlir/test/Dialect/Arith/canonicalize.mlir

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2217,12 +2217,15 @@ func.func @test_mulf1(%arg0 : f32, %arg1 : f32) -> (f32) {
22172217
}
22182218

22192219
// CHECK-LABEL: @test_mulf2(
2220-
func.func @test_mulf2(%arg0 : f32) -> f32 {
2220+
func.func @test_mulf2(%arg0 : f32) -> (f32, f32) {
22212221
// CHECK-NEXT: %[[C0:.+]] = arith.constant 0.000000e+00 : f32
2222-
// CHECK-NEXT: return %[[C0]]
2222+
// CHECK-NEXT: %[[C0n:.+]] = arith.constant -0.000000e+00 : f32
2223+
// CHECK-NEXT: return %[[C0]], %[[C0n]]
22232224
%c0 = arith.constant 0.0 : f32
2225+
%c0n = arith.constant -0.0 : f32
22242226
%0 = arith.mulf %c0, %arg0 fastmath<nnan,nsz> : f32
2225-
return %0 : f32
2227+
%1 = arith.mulf %c0n, %arg0 fastmath<nnan,nsz> : f32
2228+
return %0, %1 : f32, f32
22262229
}
22272230

22282231
// -----

0 commit comments

Comments
 (0)