summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/libcxx/debug/containers/db_sequence_container_iterators.pass.cpp57
-rw-r--r--test/std/language.support/support.exception/uncaught/uncaught_exceptions.pass.cpp50
2 files changed, 86 insertions, 21 deletions
diff --git a/test/libcxx/debug/containers/db_sequence_container_iterators.pass.cpp b/test/libcxx/debug/containers/db_sequence_container_iterators.pass.cpp
index 3ae009a8e96c..57d16c2723f7 100644
--- a/test/libcxx/debug/containers/db_sequence_container_iterators.pass.cpp
+++ b/test/libcxx/debug/containers/db_sequence_container_iterators.pass.cpp
@@ -42,6 +42,7 @@ public:
Base::run();
try {
FrontOnEmptyContainer();
+
if constexpr (CT != CT_ForwardList) {
AssignInvalidates();
BackOnEmptyContainer();
@@ -50,6 +51,8 @@ public:
InsertIterIterIter();
EmplaceIterValue();
EraseIterIter();
+ } else {
+ SpliceFirstElemAfter();
}
if constexpr (CT == CT_Vector || CT == CT_Deque || CT == CT_List) {
PopBack();
@@ -57,12 +60,66 @@ public:
if constexpr (CT == CT_List || CT == CT_Deque) {
PopFront(); // FIXME: Run with forward list as well
}
+ if constexpr (CT == CT_List || CT == CT_ForwardList) {
+ RemoveFirstElem();
+ }
+ if constexpr (CT == CT_List) {
+ SpliceFirstElem();
+ }
} catch (...) {
assert(false && "uncaught debug exception");
}
}
private:
+ static void RemoveFirstElem() {
+ // See llvm.org/PR35564
+ CHECKPOINT("remove(<first-elem>)");
+ {
+ Container C = makeContainer(1);
+ auto FirstVal = *(C.begin());
+ C.remove(FirstVal);
+ assert(C.empty());
+ }
+ {
+ Container C = {1, 1, 1, 1};
+ auto FirstVal = *(C.begin());
+ C.remove(FirstVal);
+ assert(C.empty());
+ }
+ }
+
+ static void SpliceFirstElem() {
+ // See llvm.org/PR35564
+ CHECKPOINT("splice(<first-elem>)");
+ {
+ Container C = makeContainer(1);
+ Container C2;
+ C2.splice(C2.end(), C, C.begin(), ++C.begin());
+ }
+ {
+ Container C = makeContainer(1);
+ Container C2;
+ C2.splice(C2.end(), C, C.begin());
+ }
+ }
+
+
+ static void SpliceFirstElemAfter() {
+ // See llvm.org/PR35564
+ CHECKPOINT("splice(<first-elem>)");
+ {
+ Container C = makeContainer(1);
+ Container C2;
+ C2.splice_after(C2.begin(), C, C.begin(), ++C.begin());
+ }
+ {
+ Container C = makeContainer(1);
+ Container C2;
+ C2.splice_after(C2.begin(), C, C.begin());
+ }
+ }
+
static void AssignInvalidates() {
CHECKPOINT("assign(Size, Value)");
Container C(allocator_type{});
diff --git a/test/std/language.support/support.exception/uncaught/uncaught_exceptions.pass.cpp b/test/std/language.support/support.exception/uncaught/uncaught_exceptions.pass.cpp
index e35e7afa322a..0a63a47429a6 100644
--- a/test/std/language.support/support.exception/uncaught/uncaught_exceptions.pass.cpp
+++ b/test/std/language.support/support.exception/uncaught/uncaught_exceptions.pass.cpp
@@ -15,40 +15,48 @@
// XFAIL: availability=macosx10.9
// XFAIL: availability=macosx10.10
// XFAIL: availability=macosx10.11
+// XFAIL: with_system_cxx_lib=macosx10.12
+// XFAIL: with_system_cxx_lib=macosx10.13
// test uncaught_exceptions
#include <exception>
#include <cassert>
-struct A
-{
- ~A()
- {
- assert(std::uncaught_exceptions() > 0);
- }
-};
+struct Uncaught {
+ Uncaught(int depth) : d_(depth) {}
+ ~Uncaught() { assert(std::uncaught_exceptions() == d_); }
+ int d_;
+ };
-struct B
-{
- B()
- {
- // http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#475
- assert(std::uncaught_exceptions() == 0);
+struct Outer {
+ Outer(int depth) : d_(depth) {}
+ ~Outer() {
+ try {
+ assert(std::uncaught_exceptions() == d_);
+ Uncaught u(d_+1);
+ throw 2;
}
+ catch (int) {}
+ }
+ int d_;
};
-int main()
-{
- try
+int main () {
+ assert(std::uncaught_exceptions() == 0);
{
- A a;
- assert(std::uncaught_exceptions() == 0);
- throw B();
+ Outer o(0);
}
- catch (...)
+
+ assert(std::uncaught_exceptions() == 0);
{
- assert(std::uncaught_exception() == 0);
+ try {
+ Outer o(1);
+ throw 1;
+ }
+ catch (int) {
+ assert(std::uncaught_exceptions() == 0);
+ }
}
assert(std::uncaught_exceptions() == 0);
}