Asiri Rathnayake | 4174e8b | 2016-05-31 12:01:32 +0000 | [diff] [blame] | 1 | //===----------------------- noexception4.pass.cpp ------------------------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is dual licensed under the MIT and the University of Illinois Open |
| 6 | // Source Licenses. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | // REQUIRES: libcxxabi-no-exceptions |
| 11 | |
| 12 | #include <cxxabi.h> |
| 13 | #include <exception> |
| 14 | #include <cassert> |
| 15 | |
| 16 | // namespace __cxxabiv1 { |
| 17 | // void *__cxa_current_primary_exception() throw(); |
| 18 | // extern bool __cxa_uncaught_exception () throw(); |
| 19 | // extern unsigned int __cxa_uncaught_exceptions() throw(); |
| 20 | // } |
| 21 | |
| 22 | int main () |
| 23 | { |
| 24 | // Trivially |
| 25 | assert(nullptr == __cxxabiv1::__cxa_current_primary_exception()); |
| 26 | assert(!__cxxabiv1::__cxa_uncaught_exception()); |
| 27 | assert(0 == __cxxabiv1::__cxa_uncaught_exceptions()); |
| 28 | return 0; |
| 29 | } |