diff options
author | Marshall Clow <mclow.lists@gmail.com> | 2018-07-31 23:29:06 +0000 |
---|---|---|
committer | Marshall Clow <mclow.lists@gmail.com> | 2018-07-31 23:29:06 +0000 |
commit | 5802ab265cd36c0f75cbe906c3f2ca5addc9e48d (patch) | |
tree | 2cedf0b64ee5eb105858b93b06ce56d70c31cd94 /libcxx | |
parent | ae43a27f9ce8794a6a543f26cbff49d88fe9c9f6 (diff) | |
download | bcm5719-llvm-5802ab265cd36c0f75cbe906c3f2ca5addc9e48d.tar.gz bcm5719-llvm-5802ab265cd36c0f75cbe906c3f2ca5addc9e48d.zip |
Test for the presence of a bunch of new macros for c++17. These macros come from C11. Part of P0063
llvm-svn: 338454
Diffstat (limited to 'libcxx')
-rw-r--r-- | libcxx/include/cfloat | 10 | ||||
-rw-r--r-- | libcxx/include/float.h | 11 | ||||
-rw-r--r-- | libcxx/test/std/depr/depr.c.headers/float_h.pass.cpp | 42 | ||||
-rw-r--r-- | libcxx/test/std/language.support/support.limits/c.limits/cfloat.pass.cpp | 42 |
4 files changed, 105 insertions, 0 deletions
diff --git a/libcxx/include/cfloat b/libcxx/include/cfloat index 176fa9de3ce..0abe84bf175 100644 --- a/libcxx/include/cfloat +++ b/libcxx/include/cfloat @@ -20,11 +20,18 @@ Macros: FLT_EVAL_METHOD // C99 FLT_RADIX + FLT_HAS_SUBNORM // C11 + DBL_HAS_SUBNORM // C11 + LDBL_HAS_SUBNORM // C11 + FLT_MANT_DIG DBL_MANT_DIG LDBL_MANT_DIG DECIMAL_DIG // C99 + FLT_DECIMAL_DIG // C11 + DBL_DECIMAL_DIG // C11 + LDBL_DECIMAL_DIG // C11 FLT_DIG DBL_DIG @@ -58,6 +65,9 @@ Macros: DBL_MIN LDBL_MIN + FLT_TRUE_MIN // C11 + DBL_TRUE_MIN // C11 + LDBL_TRUE_MIN // C11 */ #include <__config> diff --git a/libcxx/include/float.h b/libcxx/include/float.h index 1acfdc6188f..759ac8e7954 100644 --- a/libcxx/include/float.h +++ b/libcxx/include/float.h @@ -24,7 +24,14 @@ Macros: DBL_MANT_DIG LDBL_MANT_DIG + FLT_HAS_SUBNORM // C11 + DBL_HAS_SUBNORM // C11 + LDBL_HAS_SUBNORM // C11 + DECIMAL_DIG // C99 + FLT_DECIMAL_DIG // C11 + DBL_DECIMAL_DIG // C11 + LDBL_DECIMAL_DIG // C11 FLT_DIG DBL_DIG @@ -58,6 +65,10 @@ Macros: DBL_MIN LDBL_MIN + FLT_TRUE_MIN // C11 + DBL_TRUE_MIN // C11 + LDBL_TRUE_MIN // C11 + */ #include <__config> diff --git a/libcxx/test/std/depr/depr.c.headers/float_h.pass.cpp b/libcxx/test/std/depr/depr.c.headers/float_h.pass.cpp index 5b2e4516370..3001c215cd1 100644 --- a/libcxx/test/std/depr/depr.c.headers/float_h.pass.cpp +++ b/libcxx/test/std/depr/depr.c.headers/float_h.pass.cpp @@ -23,6 +23,20 @@ #error FLT_RADIX not defined #endif +#if TEST_STD_VER > 14 && defined(TEST_HAS_C11_FEATURES) +#ifndef FLT_HAS_SUBNORM +#error FLT_HAS_SUBNORM not defined +#endif + +#ifndef DBL_HAS_SUBNORM +#error DBL_HAS_SUBNORM not defined +#endif + +#ifndef LDBL_HAS_SUBNORM +#error LDBL_HAS_SUBNORM not defined +#endif +#endif + #ifndef FLT_MANT_DIG #error FLT_MANT_DIG not defined #endif @@ -39,6 +53,20 @@ #error DECIMAL_DIG not defined #endif +#if TEST_STD_VER > 14 && defined(TEST_HAS_C11_FEATURES) +#ifndef FLT_DECIMAL_DIG +#error FLT_DECIMAL_DIG not defined +#endif + +#ifndef DBL_DECIMAL_DIG +#error DBL_DECIMAL_DIG not defined +#endif + +#ifndef LDBL_DECIMAL_DIG +#error LDBL_DECIMAL_DIG not defined +#endif +#endif + #ifndef FLT_DIG #error FLT_DIG not defined #endif @@ -135,6 +163,20 @@ #error LDBL_MIN not defined #endif +#if TEST_STD_VER > 14 && defined(TEST_HAS_C11_FEATURES) +#ifndef FLT_TRUE_MIN +#error FLT_TRUE_MIN not defined +#endif + +#ifndef DBL_TRUE_MIN +#error DBL_TRUE_MIN not defined +#endif + +#ifndef LDBL_TRUE_MIN +#error LDBL_TRUE_MIN not defined +#endif +#endif + int main() { } diff --git a/libcxx/test/std/language.support/support.limits/c.limits/cfloat.pass.cpp b/libcxx/test/std/language.support/support.limits/c.limits/cfloat.pass.cpp index 5f63af68f70..6e399d0934b 100644 --- a/libcxx/test/std/language.support/support.limits/c.limits/cfloat.pass.cpp +++ b/libcxx/test/std/language.support/support.limits/c.limits/cfloat.pass.cpp @@ -23,6 +23,20 @@ #error FLT_RADIX not defined #endif +#if TEST_STD_VER > 14 && defined(TEST_HAS_C11_FEATURES) +#ifndef FLT_HAS_SUBNORM +#error FLT_HAS_SUBNORM not defined +#endif + +#ifndef DBL_HAS_SUBNORM +#error DBL_HAS_SUBNORM not defined +#endif + +#ifndef LDBL_HAS_SUBNORM +#error LDBL_HAS_SUBNORM not defined +#endif +#endif + #ifndef FLT_MANT_DIG #error FLT_MANT_DIG not defined #endif @@ -39,6 +53,20 @@ #error DECIMAL_DIG not defined #endif +#if TEST_STD_VER > 14 && defined(TEST_HAS_C11_FEATURES) +#ifndef FLT_DECIMAL_DIG +#error FLT_DECIMAL_DIG not defined +#endif + +#ifndef DBL_DECIMAL_DIG +#error DBL_DECIMAL_DIG not defined +#endif + +#ifndef LDBL_DECIMAL_DIG +#error LDBL_DECIMAL_DIG not defined +#endif +#endif + #ifndef FLT_DIG #error FLT_DIG not defined #endif @@ -135,6 +163,20 @@ #error LDBL_MIN not defined #endif +#if TEST_STD_VER > 14 && defined(TEST_HAS_C11_FEATURES) +#ifndef FLT_TRUE_MIN +#error FLT_TRUE_MIN not defined +#endif + +#ifndef DBL_TRUE_MIN +#error DBL_TRUE_MIN not defined +#endif + +#ifndef LDBL_TRUE_MIN +#error LDBL_TRUE_MIN not defined +#endif +#endif + int main() { } |