1 //===----------------------------------------------------------------------===// 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 // "support/test_macros.hpp" 11 12 // #define TEST_HAS_NO_EXCEPTIONS 13 14 #include "test_macros.h" 15 16 int main() { 17 #if defined(TEST_HAS_NO_EXCEPTIONS) 18 try { ((void)0); } catch (...) {} // expected-error {{exceptions disabled}} 19 #else 20 try { ((void)0); } catch (...) {} 21 #error exceptions enabled 22 // expected-error@-1 {{exceptions enabled}} 23 #endif 24 } 25