From 8ef921a48b2cf8a4e4923a6210d2e96060ebce1d Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Mon, 27 Oct 2014 20:02:19 +0000 Subject: Frontend: Define __EXCEPTIONS if -fexceptions is passed GCC defines __EXCEPTIONS, regardless of language mode, if -fexceptions is passed. We should do the same. This fixes PR21358. llvm-svn: 220714 --- clang/test/Frontend/exceptions.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'clang/test/Frontend/exceptions.c') diff --git a/clang/test/Frontend/exceptions.c b/clang/test/Frontend/exceptions.c index 4bbaaa39bfa..981b5b9045b 100644 --- a/clang/test/Frontend/exceptions.c +++ b/clang/test/Frontend/exceptions.c @@ -1,6 +1,9 @@ -// RUN: %clang_cc1 -fms-compatibility -fexceptions -fcxx-exceptions -verify %s +// RUN: %clang_cc1 -fms-compatibility -fexceptions -fcxx-exceptions -DMS_MODE -verify %s // expected-no-diagnostics -#if defined(__EXCEPTIONS) +// RUN: %clang_cc1 -fms-compatibility -fexceptions -verify %s +// expected-no-diagnostics + +#if defined(MS_MODE) && defined(__EXCEPTIONS) #error __EXCEPTIONS should not be defined. #endif -- cgit v1.2.3