summaryrefslogtreecommitdiffstats
path: root/libcxx/test
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanaka@apple.com>2018-05-23 17:31:09 +0000
committerAkira Hatanaka <ahatanaka@apple.com>2018-05-23 17:31:09 +0000
commitad3be5c454e150918c6255d2865623cb4ffdbcac (patch)
tree3dbd742eebf50d19cc3f7d0dd78545f16d3ee747 /libcxx/test
parentef33edd9b5e321a7248f30b7c9d1794039013b8b (diff)
downloadbcm5719-llvm-ad3be5c454e150918c6255d2865623cb4ffdbcac.tar.gz
bcm5719-llvm-ad3be5c454e150918c6255d2865623cb4ffdbcac.zip
Teach __libcpp_is_floating_point that __fp16 and _Float16 are
floating-point types. rdar://problem/40377353 llvm-svn: 333103
Diffstat (limited to 'libcxx/test')
-rw-r--r--libcxx/test/libcxx/type_traits/is_floating_point.pass.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/libcxx/test/libcxx/type_traits/is_floating_point.pass.cpp b/libcxx/test/libcxx/type_traits/is_floating_point.pass.cpp
new file mode 100644
index 00000000000..f164ac91890
--- /dev/null
+++ b/libcxx/test/libcxx/type_traits/is_floating_point.pass.cpp
@@ -0,0 +1,22 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// <type_traits>
+//
+// Test that is_floating_point<T>::value is true when T=__fp16 or T=_Float16.
+
+#include <type_traits>
+
+int main() {
+ static_assert(std::is_floating_point<__fp16>::value, "");
+#ifdef __FLT16_MANT_DIG__
+ static_assert(std::is_floating_point<_Float16>::value, "");
+#endif
+ return 0;
+}
OpenPOWER on IntegriCloud