xref: /aosp_15_r20/external/clang/test/Lexer/has_feature_exceptions.cpp (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li // RUN: %clang -E -fexceptions %s -o - | FileCheck --check-prefix=CHECK-EXCEPTIONS %s
2*67e74705SXin Li // RUN: %clang -E -fexceptions -fno-cxx-exceptions %s -o - | FileCheck --check-prefix=CHECK-NO-EXCEPTIONS %s
3*67e74705SXin Li // RUN: %clang -E -fno-exceptions %s -o - | FileCheck --check-prefix=CHECK-NO-EXCEPTIONS %s
4*67e74705SXin Li 
5*67e74705SXin Li // RUN: %clang_cc1 -E -fcxx-exceptions %s -o - | FileCheck --check-prefix=CHECK-EXCEPTIONS %s
6*67e74705SXin Li // RUN: %clang_cc1 -E -fobjc-exceptions %s -o - | FileCheck --check-prefix=CHECK-NO-EXCEPTIONS %s
7*67e74705SXin Li // RUN: %clang_cc1 -E -fexceptions %s -o - | FileCheck --check-prefix=CHECK-NO-EXCEPTIONS %s
8*67e74705SXin Li // RUN: %clang_cc1 -E %s -o - | FileCheck --check-prefix=CHECK-NO-EXCEPTIONS %s
9*67e74705SXin Li 
10*67e74705SXin Li #if __has_feature(cxx_exceptions)
11*67e74705SXin Li int foo();
12*67e74705SXin Li #else
13*67e74705SXin Li int bar();
14*67e74705SXin Li #endif
15*67e74705SXin Li 
16*67e74705SXin Li // CHECK-EXCEPTIONS: foo
17*67e74705SXin Li // CHECK-NO-EXCEPTIONS: bar
18