33 lines · cpp
1// We force the target to unknown because clang's default behavior for2// exception handling is target dependent.3// RUN: %clang -### -target unknown %s 2>&1 | FileCheck %s -check-prefix=DEFAULT4// DEFAULT: "-cc1" {{.*}} "-fcxx-exceptions" "-fexceptions"5//6// RUN: %clang -### -fexceptions %s 2>&1 | FileCheck %s -check-prefix=ON17// ON1: "-cc1" {{.*}} "-fcxx-exceptions" "-fexceptions"8//9// RUN: %clang -### -fno-exceptions -fcxx-exceptions %s 2>&1 | FileCheck %s -check-prefix=ON210// ON2: "-cc1" {{.*}} "-fcxx-exceptions" "-fexceptions"11//12// RUN: %clang -### -fno-cxx-exceptions -fexceptions %s 2>&1 | FileCheck %s -check-prefix=ON313// ON3: "-cc1" {{.*}} "-fcxx-exceptions" "-fexceptions"14//15// RUN: %clang -### -fno-exceptions %s 2>&1 | FileCheck %s -check-prefix=OFF116// OFF1-NOT: "-cc1" {{.*}} "-fcxx-exceptions"17//18// RUN: %clang -### -fno-cxx-exceptions %s 2>&1 | FileCheck %s -check-prefix=OFF219// OFF2-NOT: "-cc1" {{.*}} "-fcxx-exceptions"20//21// RUN: %clang -### -fcxx-exceptions -fno-exceptions %s 2>&1 | FileCheck %s -check-prefix=OFF322// OFF3-NOT: "-cc1" {{.*}} "-fcxx-exceptions"23//24// RUN: %clang -### -fexceptions -fno-cxx-exceptions %s 2>&1 | FileCheck %s -check-prefix=OFF425// OFF4-NOT: "-cc1" {{.*}} "-fcxx-exceptions"26//27// RUN: %clang -### -target x86_64-scei-ps4 %s 2>&1 | FileCheck %s -check-prefix=PS-OFF28// RUN: %clang -### -target x86_64-sie-ps5 %s 2>&1 | FileCheck %s -check-prefix=PS-OFF29// PS-OFF-NOT: "-cc1" {{.*}} "-f{{(cxx-)?}}exceptions"30 31// RUN: %clang -### -fexceptions -fno-assume-nothrow-exception-dtor -fassume-nothrow-exception-dtor %s 2>&1 | FileCheck %s --check-prefix=NOTHROW-DTOR32// NOTHROW-DTOR: "-cc1"{{.*}} "-fcxx-exceptions" "-fassume-nothrow-exception-dtor"33