summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChad Loder <cloder@cvs.openbsd.org>2005-12-17 20:05:50 +0000
committerChad Loder <cloder@cvs.openbsd.org>2005-12-17 20:05:50 +0000
commitdc952291873344ef87613450c3d233b4dffd875d (patch)
tree0f80013ff9e3cbdb9accedf07f9ff3b275e4ab46
parent5407b158e70d5c6ceace181a12861e9d259bb7ee (diff)
Add some tests with modulus operator too
-rw-r--r--regress/usr.bin/xlint/test-15.c21
-rw-r--r--regress/usr.bin/xlint/test-15.c.exp2
2 files changed, 14 insertions, 9 deletions
diff --git a/regress/usr.bin/xlint/test-15.c b/regress/usr.bin/xlint/test-15.c
index 3ff79a3b768..7bc6a5d0d40 100644
--- a/regress/usr.bin/xlint/test-15.c
+++ b/regress/usr.bin/xlint/test-15.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: test-15.c,v 1.1 2005/12/16 03:02:22 cloder Exp $ */
+/* $OpenBSD: test-15.c,v 1.2 2005/12/17 20:05:49 cloder Exp $ */
/*
* Placed in the public domain by Chad Loder <cloder@openbsd.org>.
@@ -24,15 +24,18 @@ main(int argc, char* argv[])
int i;
float f;
- i = 0 / 0;
- f = 0.0f / 0.0f;
- d = 0.0 / 0.0;
- L = 0L / 0L;
+ i = 1 / 0;
+ f = 1.0f / 0.0f;
+ d = 1.0 / 0.0;
+ L = 1L / 0L;
- dbzd(0.0 / 0.0);
- dbzf(0.0f / 0.0f);
- dbzi(0 / 0);
- dbzl(0L / 0L);
+ dbzd(1.0 / 0.0);
+ dbzf(1.0f / 0.0f);
+ dbzi(1 / 0);
+ dbzl(1L / 0L);
+
+ i = 1 % 0;
+ L = 1L % 0L;
i++;
f++;
diff --git a/regress/usr.bin/xlint/test-15.c.exp b/regress/usr.bin/xlint/test-15.c.exp
index 895f27b0eb0..5413214998f 100644
--- a/regress/usr.bin/xlint/test-15.c.exp
+++ b/regress/usr.bin/xlint/test-15.c.exp
@@ -6,4 +6,6 @@ test-15.c:32: warning: division by 0
test-15.c:33: warning: division by 0
test-15.c:34: warning: division by 0
test-15.c:35: warning: division by 0
+test-15.c:37: warning: modulus by 0
+test-15.c:38: warning: modulus by 0
Lint pass2: