summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Lexer/has_extension.c8
-rw-r--r--clang/test/Lexer/has_feature_c1x.c12
-rw-r--r--clang/test/Lexer/has_feature_cxx0x.cpp10
3 files changed, 26 insertions, 4 deletions
diff --git a/clang/test/Lexer/has_extension.c b/clang/test/Lexer/has_extension.c
index 2ab3d1df37a..b7efece64e8 100644
--- a/clang/test/Lexer/has_extension.c
+++ b/clang/test/Lexer/has_extension.c
@@ -36,6 +36,14 @@ int has_c_alignas();
int no_c_alignas();
#endif
+// CHECK-PED-NONE: has_c_alignof
+// CHECK-PED-ERR: no_c_alignof
+#if __has_extension(c_alignof)
+int has_c_alignof();
+#else
+int no_c_alignof();
+#endif
+
// Arbitrary feature to test that the extension name can be surrounded with
// double underscores.
// CHECK-PED-NONE: has_double_underscores
diff --git a/clang/test/Lexer/has_feature_c1x.c b/clang/test/Lexer/has_feature_c1x.c
index cba329cfb55..ff1778010b7 100644
--- a/clang/test/Lexer/has_feature_c1x.c
+++ b/clang/test/Lexer/has_feature_c1x.c
@@ -12,7 +12,6 @@ int has_atomic();
#else
int no_atomic();
#endif
-
// CHECK-1X: has_atomic
// CHECK-NO-1X: no_atomic
@@ -21,7 +20,6 @@ int has_static_assert();
#else
int no_static_assert();
#endif
-
// CHECK-1X: has_static_assert
// CHECK-NO-1X: no_static_assert
@@ -30,7 +28,6 @@ int has_generic_selections();
#else
int no_generic_selections();
#endif
-
// CHECK-1X: has_generic_selections
// CHECK-NO-1X: no_generic_selections
@@ -39,10 +36,17 @@ int has_alignas();
#else
int no_alignas();
#endif
-
// CHECK-1X: has_alignas
// CHECK-NO-1X: no_alignas
+#if __has_feature(c_alignof)
+int has_alignof();
+#else
+int no_alignof();
+#endif
+// CHECK-1X: has_alignof
+// CHECK-NO-1X: no_alignof
+
#if __has_feature(c_thread_local)
int has_thread_local();
#else
diff --git a/clang/test/Lexer/has_feature_cxx0x.cpp b/clang/test/Lexer/has_feature_cxx0x.cpp
index e558f8804b2..9fb05de31a2 100644
--- a/clang/test/Lexer/has_feature_cxx0x.cpp
+++ b/clang/test/Lexer/has_feature_cxx0x.cpp
@@ -234,6 +234,16 @@ int no_alignas();
// CHECK-11: has_alignas
// CHECK-NO-11: no_alignas
+#if __has_feature(cxx_alignof)
+int has_alignof();
+#else
+int no_alignof();
+#endif
+
+// CHECK-1Y: has_alignof
+// CHECK-11: has_alignof
+// CHECK-NO-11: no_alignof
+
#if __has_feature(cxx_raw_string_literals)
int has_raw_string_literals();
#else
OpenPOWER on IntegriCloud