summaryrefslogtreecommitdiff
path: root/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_align_nothrow.sh.cpp
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2018-08-16 09:52:16 +0000
committerHans Wennborg <hans@hanshq.net>2018-08-16 09:52:16 +0000
commita30b691211c6ed981f566e09c5042cd28755e598 (patch)
tree3687963f5dc0449de5c643ec5dd2ed6aa23ed4be /test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_align_nothrow.sh.cpp
parentaf0ecbcc9a716200e8e1a52c16148818d566f41f (diff)
Merging r339743:
------------------------------------------------------------------------ r339743 | ldionne | 2018-08-15 02:30:03 +0200 (Wed, 15 Aug 2018) | 14 lines [libcxx] Fix XFAILs for aligned allocation tests on older OSX versions Summary: Since r338934, Clang emits an error when aligned allocation functions are used in conjunction with a system libc++ dylib that does not support those functions. This causes some tests to fail when testing against older libc++ dylibs. This commit marks those tests as UNSUPPORTED, and also documents the various reasons for the tests being unsupported. Reviewers: vsapsai, EricWF Subscribers: christof, dexonsmith, cfe-commits, mclow.lists, EricWF Differential Revision: https://reviews.llvm.org/D50341 ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/libcxx/branches/release_70@339854 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_align_nothrow.sh.cpp')
-rw-r--r--test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_align_nothrow.sh.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_align_nothrow.sh.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_align_nothrow.sh.cpp
new file mode 100644
index 000000000..1fe104551
--- /dev/null
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_align_nothrow.sh.cpp
@@ -0,0 +1,26 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <new>
+
+// void* operator new(std::size_t, std::align_val_t, std::nothrow_t &);
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
+// UNSUPPORTED: clang-3.3, clang-3.4, clang-3.5, clang-3.6, clang-3.7, clang-3.8
+
+// REQUIRES: -faligned-allocation
+// RUN: %compile %verify -faligned-allocation
+
+#include <new>
+
+int main ()
+{
+ ::operator new(4, std::align_val_t{4}, std::nothrow); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+}