llvm-capstone/clang/test/Preprocessor/predefined-exceptions.m
David Majnemer 8ef921a48b 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
2014-10-27 20:02:19 +00:00

16 lines
892 B
Matlab

// RUN: %clang_cc1 -x objective-c -fobjc-exceptions -fexceptions -E -dM %s | FileCheck -check-prefix=CHECK-OBJC-NOCXX %s
// CHECK-OBJC-NOCXX: #define OBJC_ZEROCOST_EXCEPTIONS 1
// CHECK-OBJC-NOCXX: #define __EXCEPTIONS 1
// RUN: %clang_cc1 -x objective-c++ -fobjc-exceptions -fexceptions -fcxx-exceptions -E -dM %s | FileCheck -check-prefix=CHECK-OBJC-CXX %s
// CHECK-OBJC-CXX: #define OBJC_ZEROCOST_EXCEPTIONS 1
// CHECK-OBJC-CXX: #define __EXCEPTIONS 1
// RUN: %clang_cc1 -x objective-c++ -fexceptions -fcxx-exceptions -E -dM %s | FileCheck -check-prefix=CHECK-NOOBJC-CXX %s
// CHECK-NOOBJC-CXX-NOT: #define OBJC_ZEROCOST_EXCEPTIONS 1
// CHECK-NOOBJC-CXX: #define __EXCEPTIONS 1
// RUN: %clang_cc1 -x objective-c -E -dM %s | FileCheck -check-prefix=CHECK-NOOBJC-NOCXX %s
// CHECK-NOOBJC-NOCXX-NOT: #define OBJC_ZEROCOST_EXCEPTIONS 1
// CHECK-NOOBJC-NOCXX-NOT: #define __EXCEPTIONS 1