aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/Float16.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2019-02-05 18:39:15 +0000
committerDimitry Andric <dim@FreeBSD.org>2019-02-05 18:39:15 +0000
commitd87c9e7da2e87f224c426832f08897269c2e5636 (patch)
tree9492632723d36c1c80f3daca3974f362eea84a7a /test/SemaCXX/Float16.cpp
parent292698a8537d1e51bbcd339f8a19b2b7d7f1e1f6 (diff)
Notes
Diffstat (limited to 'test/SemaCXX/Float16.cpp')
-rw-r--r--test/SemaCXX/Float16.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/SemaCXX/Float16.cpp b/test/SemaCXX/Float16.cpp
new file mode 100644
index 000000000000..f27c3839854e
--- /dev/null
+++ b/test/SemaCXX/Float16.cpp
@@ -0,0 +1,18 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -triple x86_64-linux-pc %s
+// RUN: %clang_cc1 -fsyntax-only -verify -triple spir-unknown-unknown %s -DHAVE
+// RUN: %clang_cc1 -fsyntax-only -verify -triple armv7a-linux-gnu %s -DHAVE
+// RUN: %clang_cc1 -fsyntax-only -verify -triple aarch64-linux-gnu %s -DHAVE
+
+#ifdef HAVE
+// expected-no-diagnostics
+#endif // HAVE
+
+#ifndef HAVE
+// expected-error@+2{{_Float16 is not supported on this target}}
+#endif // !HAVE
+_Float16 f;
+
+#ifndef HAVE
+// expected-error@+2{{invalid suffix 'F16' on floating constant}}
+#endif // !HAVE
+const auto g = 1.1F16;