diff options
Diffstat (limited to 'config/cmake/HDFTests.c')
-rw-r--r-- | config/cmake/HDFTests.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/config/cmake/HDFTests.c b/config/cmake/HDFTests.c index 095f113..fd0beb2 100644 --- a/config/cmake/HDFTests.c +++ b/config/cmake/HDFTests.c @@ -192,3 +192,36 @@ int main () } #endif /* HAVE_IOEO */ + +#ifdef CHECK_FLOAT16 + +#define __STDC_WANT_IEC_60559_TYPES_EXT__ +#include <float.h> + +int +main(int argc, char **argv) +{ + signed char a; + _Float16 b; + double c; + + /* Convert signed char to _Float16 */ + a = 1; + b = (_Float16)a; + + /* Convert back */ + b = 3.0f16; + a = (signed char)b; + + /* Convert double to _Float16 */ + c = 5.0; + b = (_Float16)c; + + /* Convert back */ + b = 3.0f16; + c = (double)b; + + return 0; +} + +#endif /* CHECK_FLOAT16 */ |