summaryrefslogtreecommitdiff
path: root/test/Lexer/aligned-allocation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/Lexer/aligned-allocation.cpp')
-rw-r--r--test/Lexer/aligned-allocation.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/Lexer/aligned-allocation.cpp b/test/Lexer/aligned-allocation.cpp
new file mode 100644
index 000000000000..eef5d980a37b
--- /dev/null
+++ b/test/Lexer/aligned-allocation.cpp
@@ -0,0 +1,23 @@
+// RUN: %clang_cc1 -triple x86_64-apple-macosx10.12.0 -fexceptions -std=c++17 -verify %s \
+// RUN: -DEXPECT_DEFINED
+//
+// RUN: %clang_cc1 -triple x86_64-apple-macosx10.12.0 -fexceptions -std=c++17 -verify %s \
+// RUN: -faligned-alloc-unavailable
+//
+// RUN: %clang_cc1 -triple x86_64-apple-macosx10.12.0 -fexceptions -std=c++17 -verify %s \
+// RUN: -faligned-allocation -faligned-alloc-unavailable
+
+// Test that __cpp_aligned_new is not defined when CC1 is passed
+// -faligned-alloc-unavailable by the Darwin driver, even when aligned
+// allocation is actually enabled.
+
+// expected-no-diagnostics
+#ifdef EXPECT_DEFINED
+# ifndef __cpp_aligned_new
+# error "__cpp_aligned_new" should be defined
+# endif
+#else
+# ifdef __cpp_aligned_new
+# error "__cpp_aligned_new" should not be defined
+# endif
+#endif