// UNSUPPORTED: c++98, c++03
// UNSUPPORTED: libcpp-no-exceptions
+// MODULES_DEFINES: _LIBCPP_DEBUG_USE_EXCEPTIONS
+// MODULES_DEFINES: _LIBCPP_DEBUG=0
+
// <experimental/filesystem>
// class path
#define _LIBCPP_DEBUG 0
-#define _LIBCPP_ASSERT(cond, msg) ((cond) ? ((void)0) : throw 42)
-
+#define _LIBCPP_DEBUG_USE_EXCEPTIONS
#include <experimental/filesystem>
#include <iterator>
#include <type_traits>
int main() {
using namespace fs;
+ using ExType = std::__libcpp_debug_exception;
// Test incrementing/decrementing a singular iterator
{
path::iterator singular;
try {
++singular;
assert(false);
- } catch (int) {}
+ } catch (ExType const&) {}
try {
--singular;
assert(false);
- } catch (int) {}
+ } catch (ExType const&) {}
}
// Test decrementing the begin iterator
{
try {
--it;
assert(false);
- } catch (int) {}
+ } catch (ExType const&) {}
++it;
++it;
try {
++it;
assert(false);
- } catch (int) {}
+ } catch (ExType const&) {}
}
// Test incrementing the end iterator
{
try {
++it;
assert(false);
- } catch (int) {}
+ } catch (ExType const&) {}
--it;
--it;
try {
--it;
assert(false);
- } catch (int) {}
+ } catch (ExType const&) {}
}
}
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++98, c++03
+// MODULES_DEFINES: _LIBCPP_DEBUG_USE_EXCEPTIONS
+// MODULES_DEFINES: _LIBCPP_DEBUG=0
+
// <future>
// class promise<R>
// void set_exception(exception_ptr p);
// Test that a null exception_ptr is diagnosed.
-#define _LIBCPP_ASSERT(x, m) ((x) ? ((void)0) : throw 42)
-
#define _LIBCPP_DEBUG 0
+#define _LIBCPP_DEBUG_USE_EXCEPTIONS
#include <future>
#include <exception>
#include <cstdlib>
int main()
{
+ typedef std::__libcpp_debug_exception ExType;
{
typedef int T;
std::promise<T> p;
try {
p.set_exception(std::exception_ptr());
assert(false);
- } catch (int const& value) {
- assert(value == 42);
+ } catch (ExType const&) {
}
}
{
try {
p.set_exception(std::exception_ptr());
assert(false);
- } catch (int const& value) {
- assert(value == 42);
+ } catch (ExType const&) {
}
}
}
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++98, c++03
+// MODULES_DEFINES: _LIBCPP_DEBUG_USE_EXCEPTIONS
+// MODULES_DEFINES: _LIBCPP_DEBUG=0
+
// <future>
// class promise<R>
// void set_exception_on_thread_exit(exception_ptr p);
// Test that a null exception_ptr is diagnosed.
-#define _LIBCPP_ASSERT(x, m) ((x) ? ((void)0) : throw 42)
-
#define _LIBCPP_DEBUG 0
+#define _LIBCPP_DEBUG_USE_EXCEPTIONS
#include <future>
#include <exception>
#include <cstdlib>
int main()
{
+ typedef std::__libcpp_debug_exception ExType;
{
typedef int T;
std::promise<T> p;
try {
p.set_exception_at_thread_exit(std::exception_ptr());
assert(false);
- } catch (int const& value) {
- assert(value == 42);
+ } catch (ExType const& value) {
}
}
{
try {
p.set_exception_at_thread_exit(std::exception_ptr());
assert(false);
- } catch (int const& value) {
- assert(value == 42);
+ } catch (ExType const& value) {
}
}
}
self.cxx.addWarningFlagIfSupported('-Wno-user-defined-literals')
self.cxx.addWarningFlagIfSupported('-Wno-noexcept-type')
self.cxx.addWarningFlagIfSupported('-Wno-aligned-allocation-unavailable')
- # FIXME: Remove this work-around. It is a temporary hack to get the
- # throwing debug tests passing. For example:
- # * test/libcxx/experimental/filesystem/class.path/path.itr/iterator_db.pass.cpp
- # * test/libcxx/thread/futures/futures.promise/set_exception.pass.cpp
- self.cxx.addWarningFlagIfSupported("-Wno-exceptions")
# These warnings should be enabled in order to support the MSVC
# team using the test suite; They enable the warnings below and
# expect the test suite to be clean.