summaryrefslogtreecommitdiff
path: root/test/Preprocessor/has_c_attribute.c
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-12-18 20:11:37 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-12-18 20:11:37 +0000
commit461a67fa15370a9ec88f8f8a240bf7c123bb2029 (patch)
tree6942083d7d56bba40ec790a453ca58ad3baf6832 /test/Preprocessor/has_c_attribute.c
parent75c3240472ba6ac2669ee72ca67eb72d4e2851fc (diff)
Diffstat (limited to 'test/Preprocessor/has_c_attribute.c')
-rw-r--r--test/Preprocessor/has_c_attribute.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/Preprocessor/has_c_attribute.c b/test/Preprocessor/has_c_attribute.c
new file mode 100644
index 0000000000000..dc22da7e4cd60
--- /dev/null
+++ b/test/Preprocessor/has_c_attribute.c
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -fdouble-square-bracket-attributes -std=c11 -E %s -o - | FileCheck %s
+
+// CHECK: has_fallthrough
+#if __has_c_attribute(fallthrough)
+ int has_fallthrough();
+#endif
+
+// CHECK: does_not_have_selectany
+#if !__has_c_attribute(selectany)
+ int does_not_have_selectany();
+#endif
+