summaryrefslogtreecommitdiff
path: root/test/Preprocessor/is_target_unknown.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Preprocessor/is_target_unknown.c')
-rw-r--r--test/Preprocessor/is_target_unknown.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/Preprocessor/is_target_unknown.c b/test/Preprocessor/is_target_unknown.c
new file mode 100644
index 000000000000..d81afcbd2241
--- /dev/null
+++ b/test/Preprocessor/is_target_unknown.c
@@ -0,0 +1,22 @@
+// RUN: %clang_cc1 -fsyntax-only -triple i686-unknown-unknown -verify %s
+// RUN: %clang_cc1 -fsyntax-only -triple i686-- -verify %s
+// expected-no-diagnostics
+
+#if __is_target_arch(unknown)
+ #error "mismatching arch"
+#endif
+
+// Unknown vendor is allowed.
+#if !__is_target_vendor(unknown)
+ #error "mismatching vendor"
+#endif
+
+// Unknown OS is allowed.
+#if !__is_target_os(unknown)
+ #error "mismatching OS"
+#endif
+
+// Unknown environment is allowed.
+#if !__is_target_environment(unknown)
+ #error "mismatching environment"
+#endif