[RISCV][FMV] Support target_clones (#85786)
[llvm-project.git] / clang / test / Driver / clang-exception-flags.cpp
blob7b88ecdfcf333500215b0fbbf94669646759ba76
1 // We force the target to unknown because clang's default behavior for
2 // exception handling is target dependent.
3 // RUN: %clang -### -target unknown %s 2>&1 | FileCheck %s -check-prefix=DEFAULT
4 // DEFAULT: "-cc1" {{.*}} "-fcxx-exceptions" "-fexceptions"
5 //
6 // RUN: %clang -### -fexceptions %s 2>&1 | FileCheck %s -check-prefix=ON1
7 // ON1: "-cc1" {{.*}} "-fcxx-exceptions" "-fexceptions"
8 //
9 // RUN: %clang -### -fno-exceptions -fcxx-exceptions %s 2>&1 | FileCheck %s -check-prefix=ON2
10 // ON2: "-cc1" {{.*}} "-fcxx-exceptions" "-fexceptions"
12 // RUN: %clang -### -fno-cxx-exceptions -fexceptions %s 2>&1 | FileCheck %s -check-prefix=ON3
13 // ON3: "-cc1" {{.*}} "-fcxx-exceptions" "-fexceptions"
15 // RUN: %clang -### -fno-exceptions %s 2>&1 | FileCheck %s -check-prefix=OFF1
16 // OFF1-NOT: "-cc1" {{.*}} "-fcxx-exceptions"
18 // RUN: %clang -### -fno-cxx-exceptions %s 2>&1 | FileCheck %s -check-prefix=OFF2
19 // OFF2-NOT: "-cc1" {{.*}} "-fcxx-exceptions"
21 // RUN: %clang -### -fcxx-exceptions -fno-exceptions %s 2>&1 | FileCheck %s -check-prefix=OFF3
22 // OFF3-NOT: "-cc1" {{.*}} "-fcxx-exceptions"
24 // RUN: %clang -### -fexceptions -fno-cxx-exceptions %s 2>&1 | FileCheck %s -check-prefix=OFF4
25 // OFF4-NOT: "-cc1" {{.*}} "-fcxx-exceptions"
27 // RUN: %clang -### -target x86_64-scei-ps4 %s 2>&1 | FileCheck %s -check-prefix=PS-OFF
28 // RUN: %clang -### -target x86_64-sie-ps5 %s 2>&1 | FileCheck %s -check-prefix=PS-OFF
29 // PS-OFF-NOT: "-cc1" {{.*}} "-f{{(cxx-)?}}exceptions"
31 // RUN: %clang -### -fexceptions -fno-assume-nothrow-exception-dtor -fassume-nothrow-exception-dtor %s 2>&1 | FileCheck %s --check-prefix=NOTHROW-DTOR
32 // NOTHROW-DTOR: "-cc1"{{.*}} "-fcxx-exceptions" "-fassume-nothrow-exception-dtor"