[PATCH 9/9] div0: add missing tests for floating point div by zero

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---
 validation/div-by-zero-fp.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/validation/div-by-zero-fp.c b/validation/div-by-zero-fp.c
index 787af1636..957bc732c 100644
--- a/validation/div-by-zero-fp.c
+++ b/validation/div-by-zero-fp.c
@@ -3,14 +3,22 @@ double gbad(double a) { return 2.0 / 0.0; }
 double fool(double a) { return a / 0; }
 double ffoo(double a) { return a / 0.0; }
 
+double fbar(double a) { if (a && 0) a / 0.0; return 0; }
+double fbaz(double a) { return a /= 0.0; }
+double fquz(double a) { return a / (a && 0); }
+
 /*
  * check-name: div-by-zero-fp.c
  * check-command: sparse -Wno-decl $file
+ * check-known-to-fail
  *
  * check-error-start
 div-by-zero-fp.c:1:36: warning: division by zero
 div-by-zero-fp.c:2:36: warning: division by zero
 div-by-zero-fp.c:3:34: warning: division by zero
 div-by-zero-fp.c:4:34: warning: division by zero
+div-by-zero-fp.c:6:39: warning: division by zero
+div-by-zero-fp.c:7:34: warning: division by zero
+div-by-zero-fp.c:8:34: warning: division by zero
  * check-error-end
  */
-- 
2.13.0

--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux