Add C11 *_DECIMAL_DIG.
authorEd Schouten <ed@80386.nl>
Mon, 23 Feb 2015 09:12:31 +0000 (09:12 +0000)
committerEd Schouten <ed@80386.nl>
Mon, 23 Feb 2015 09:12:31 +0000 (09:12 +0000)
commit4992099b42e9bb6faceb61ed093155bf2ebe7157
tree05507f5d217f81a87b96215a2a952d58830599c7
parenteba692dd283d7bc29972670e938cb2405f509720
Add C11 *_DECIMAL_DIG.

Before C11 there was only the DECIMAL_DIG definition. As of C11, we now
have one definition per floating point type (e.g. DBL_DECIMAL_DIG).
Change the existing code to define the new versions. To remain backward
compatible, define __DECIMAL_DIG__ as __LDBL_DECIMAL_DIG__.

Also update the tests. It seems that some of the existing test vectors
were incorrect. Change all tests for __DECIMAL_DIG__ to expect
__LDBL_DECIMAL_DIG__. Add tests for *_DECIMAL_DIG for FreeBSD/amd64, as
I happen to have such a system laying around. I've validated that the
values are in sync with <float.h>.

llvm-svn: 230207
clang/lib/Frontend/InitPreprocessor.cpp
clang/test/Preprocessor/init.c