diff options
author | kettenis <> | 2006-05-15 14:00:22 +0000 |
---|---|---|
committer | kettenis <> | 2006-05-15 14:00:22 +0000 |
commit | 18756a40ff21d843e407ceffbdf5be0c1c941b86 (patch) | |
tree | 6bd91fbd04227285891142917aed936b3a6a24af /src | |
parent | f4c37a9f841e7402e56dcdfd8c296dfda1089c30 (diff) | |
download | openbsd-18756a40ff21d843e407ceffbdf5be0c1c941b86.tar.gz openbsd-18756a40ff21d843e407ceffbdf5be0c1c941b86.tar.bz2 openbsd-18756a40ff21d843e407ceffbdf5be0c1c941b86.zip |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/regress/lib/libc/ieeefp/except/except.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/regress/lib/libc/ieeefp/except/except.c b/src/regress/lib/libc/ieeefp/except/except.c index 22bd6809a8..1d11877777 100644 --- a/src/regress/lib/libc/ieeefp/except/except.c +++ b/src/regress/lib/libc/ieeefp/except/except.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: except.c,v 1.9 2004/12/22 00:54:39 david Exp $ */ | 1 | /* $OpenBSD: except.c,v 1.10 2006/05/15 14:00:22 kettenis Exp $ */ |
2 | 2 | ||
3 | #include <sys/types.h> | 3 | #include <sys/types.h> |
4 | #include <unistd.h> | 4 | #include <unistd.h> |
@@ -97,5 +97,11 @@ main(int argc, char *argv[]) | |||
97 | errx(1, "unrecognized condition %s", argv[1]); | 97 | errx(1, "unrecognized condition %s", argv[1]); |
98 | } | 98 | } |
99 | 99 | ||
100 | /* | ||
101 | * attempt to trigger the exception on machines where | ||
102 | * floating-point exceptions are deferred. | ||
103 | */ | ||
104 | x = one * one; | ||
105 | |||
100 | errx(1, "signal wasn't caught"); | 106 | errx(1, "signal wasn't caught"); |
101 | } | 107 | } |