summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2006-05-15 14:00:23 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2006-05-15 14:00:23 +0000
commite2e4e4f07e8bf8c8f9e16bbece62c492070d1051 (patch)
tree7d283157ed97f323415614066ab7da9d6d423de2
parent7242a7f634a024d42751ad470263c02660bbeaf5 (diff)
Try harder to trigger an exception. On architectures where floating-point
exceptions are deferred, we might not see the exception before another floating-point instruction is executed. This is especially true on the i387 where we don't see underflow/overflow until the result is stored into memory.
-rw-r--r--regress/lib/libc/ieeefp/except/except.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/regress/lib/libc/ieeefp/except/except.c b/regress/lib/libc/ieeefp/except/except.c
index 22bd6809a85..1d118777775 100644
--- a/regress/lib/libc/ieeefp/except/except.c
+++ b/regress/lib/libc/ieeefp/except/except.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: except.c,v 1.9 2004/12/22 00:54:39 david Exp $ */
+/* $OpenBSD: except.c,v 1.10 2006/05/15 14:00:22 kettenis Exp $ */
#include <sys/types.h>
#include <unistd.h>
@@ -97,5 +97,11 @@ main(int argc, char *argv[])
errx(1, "unrecognized condition %s", argv[1]);
}
+ /*
+ * attempt to trigger the exception on machines where
+ * floating-point exceptions are deferred.
+ */
+ x = one * one;
+
errx(1, "signal wasn't caught");
}