Files
android_external_libcxx/test/libcxx/debug/debug_throw_register.pass.cpp
Eric Fiselier cd4ab9c404 Fix test failures when using modules.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294353 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-07 21:20:31 +00:00

34 lines
852 B
C++

// -*- 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.
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: libcpp-no-exceptions
// MODULES_DEFINES: _LIBCPP_DEBUG=1
// MODULES_DEFINES: _LIBCPP_DEBUG_USE_EXCEPTIONS
// Test that defining _LIBCPP_DEBUG_USE_EXCEPTIONS causes _LIBCPP_ASSERT
// to throw on failure.
#define _LIBCPP_DEBUG 1
#define _LIBCPP_DEBUG_USE_EXCEPTIONS
#include <cstdlib>
#include <exception>
#include <type_traits>
#include <__debug>
#include <cassert>
int main()
{
try {
_LIBCPP_ASSERT(false, "foo");
assert(false);
} catch (...) {}
}