summaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/dfp/inf-1.c
diff options
context:
space:
mode:
authorupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
committerupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
commit554fd8c5195424bdbcabf5de30fdc183aba391bd (patch)
tree976dc5ab7fddf506dadce60ae936f43f58787092 /gcc/testsuite/c-c++-common/dfp/inf-1.c
downloadcbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.bz2
cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.xz
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository.
Diffstat (limited to 'gcc/testsuite/c-c++-common/dfp/inf-1.c')
-rw-r--r--gcc/testsuite/c-c++-common/dfp/inf-1.c61
1 files changed, 61 insertions, 0 deletions
diff --git a/gcc/testsuite/c-c++-common/dfp/inf-1.c b/gcc/testsuite/c-c++-common/dfp/inf-1.c
new file mode 100644
index 000000000..c4f8cd796
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/dfp/inf-1.c
@@ -0,0 +1,61 @@
+/* N1150 4: Characteristics of decimal floating types (not explicit)
+ C99 5.2.4.2.2: Characteristics of floating types.
+ A few simple checks on arithmetic operations. */
+
+#include "dfp-dbg.h"
+
+int main()
+{
+ /* Assumes rounding mode. */
+ if (9999999.E90DF + 1.E90df != __builtin_infd32 ())
+ FAILURE
+
+ if (!__builtin_isinfd32 (9999999.E90DF + 1.E90df))
+ FAILURE
+
+ if (9.999999999999999E384dd + .000000000000001e384dd
+ != __builtin_infd32 ())
+ FAILURE
+
+ if (-9999999.E90DF - 1.E90df != -__builtin_infd32 ())
+ FAILURE
+
+ if (!__builtin_isinfd32 (9.999999999999999E384dd + .000000000000001e384dd))
+ FAILURE
+
+ if (7.999999999999999999999999999999999E6144dl + 3.0E6144dl
+ != __builtin_infd32 ())
+ FAILURE
+
+ if (__builtin_infd32 () * __builtin_infd32 () != __builtin_infd32 ())
+ FAILURE
+
+ if (__builtin_infd32 () * 2 != __builtin_infd32 ())
+ FAILURE
+
+ if (__builtin_infd64 () * -5 != -__builtin_infd32 ())
+ FAILURE
+
+ if (!__builtin_isinfd128 (__builtin_infd32 () / 4))
+ FAILURE
+
+ if (__builtin_infd64 () != __builtin_infd128 ())
+ FAILURE
+
+ if (!__builtin_isinfd64 (__builtin_infd128 ()))
+ FAILURE
+
+ if (__builtin_finited64 (__builtin_infd32 () * 4))
+ FAILURE
+
+ if (!__builtin_finited128 (9.999999E90DL - 1.E90dd))
+ FAILURE
+
+ if (__builtin_finited128 (__builtin_infd32 () *__builtin_infd128 ()))
+ FAILURE
+
+ if (__builtin_finited32 (__builtin_nand32 ("")))
+ FAILURE
+
+ FINISH
+}