xref: /llvm-project/libcxx/test/support/test.support/test_macros_header.no_exceptions.verify.cpp (revision 72f0edf3f4291d2614719a8c8af21a7a62ed5d74)
1bb09ef95SLouis Dionne //===----------------------------------------------------------------------===//
2bb09ef95SLouis Dionne //
3bb09ef95SLouis Dionne // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4bb09ef95SLouis Dionne // See https://llvm.org/LICENSE.txt for license information.
5bb09ef95SLouis Dionne // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6bb09ef95SLouis Dionne //
7bb09ef95SLouis Dionne //===----------------------------------------------------------------------===//
8bb09ef95SLouis Dionne 
9bb09ef95SLouis Dionne // Make sure the TEST_HAS_NO_EXCEPTIONS macro is defined when exceptions are
10bb09ef95SLouis Dionne // disabled.
11bb09ef95SLouis Dionne 
12bb09ef95SLouis Dionne // REQUIRES: no-exceptions
13bb09ef95SLouis Dionne 
14bb09ef95SLouis Dionne #include "test_macros.h"
15bb09ef95SLouis Dionne 
16bb09ef95SLouis Dionne #ifndef TEST_HAS_NO_EXCEPTIONS
17bb09ef95SLouis Dionne #  error "TEST_HAS_NO_EXCEPTIONS should be defined"
18bb09ef95SLouis Dionne #endif
19bb09ef95SLouis Dionne 
f()20*72f0edf3SLouis Dionne void f() {
21bb09ef95SLouis Dionne     try { (void)0; } catch (...) { } // expected-error {{exceptions disabled}}
22bb09ef95SLouis Dionne }
23