summaryrefslogtreecommitdiff
path: root/test/Preprocessor/has_c_attribute.c
diff options
context:
space:
mode:
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
+