@@ -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
*/
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com> --- validation/div-by-zero-fp.c | 8 ++++++++ 1 file changed, 8 insertions(+)