Files
android_external_libcxx/test/libcxx/thread/futures/futures.promise/set_exception.pass.cpp
Eric Fiselier c94dd0a571 XFAIL Windows test failures under test/libcxx
This patch XFAIL's a number of tests under test/libcxx when on Windows.
These failures need more investigation or patches to either Clang or libc++
but for now we don't want them to prevent the bot from going green.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300941 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-21 01:48:02 +00:00

57 lines
1.3 KiB
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.
//
//===----------------------------------------------------------------------===//
//
// This test depends on std::exception_ptr which has not yet been implemented.
// XFAIL: LIBCXX-WINDOWS-FIXME
// UNSUPPORTED: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: c++98, c++03
// <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
#include <future>
#include <exception>
#include <cstdlib>
#include <cassert>
int main()
{
{
typedef int T;
std::promise<T> p;
try {
p.set_exception(std::exception_ptr());
assert(false);
} catch (int const& value) {
assert(value == 42);
}
}
{
typedef int& T;
std::promise<T> p;
try {
p.set_exception(std::exception_ptr());
assert(false);
} catch (int const& value) {
assert(value == 42);
}
}
}