| 1 |
// RUN: %clang_cc1 -triple i686-unknown-linux-gnu -fexceptions -fcxx-exceptions -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-GNU |
| 2 |
// RUN: %clang_cc1 -triple i686-unknown-linux-gnu -fexceptions -exception-model=dwarf -fcxx-exceptions -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-GNU-DWARF |
| 3 |
// RUN: %clang_cc1 -triple i686-unknown-linux-gnu -fexceptions -exception-model=seh -fcxx-exceptions -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-GNU-SEH |
| 4 |
// RUN: %clang_cc1 -triple i686-unknown-linux-gnu -fexceptions -exception-model=sjlj -fcxx-exceptions -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-GNU-SJLJ |
| 5 |
|
| 6 |
// RUN: %clang_cc1 -triple i686-unknown-windows-msvc -fexceptions -fcxx-exceptions -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-WIN |
| 7 |
// RUN: %clang_cc1 -triple i686-unknown-windows-msvc -D __SEH_EXCEPTIONS__ -fms-extensions -fexceptions -fcxx-exceptions -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-WIN-SEH-X86 |
| 8 |
// RUN: %clang_cc1 -triple x86_64-unknown-windows-msvc -D __SEH_EXCEPTIONS__ -fms-extensions -fexceptions -fcxx-exceptions -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-WIN-SEH-X64 |
| 9 |
|
| 10 |
// RUN: %clang_cc1 -triple i686-unknown-windows-gnu -fexceptions -fcxx-exceptions -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-GNU |
| 11 |
// RUN: %clang_cc1 -triple i686-unknown-windows-gnu -fexceptions -exception-model=dwarf -fcxx-exceptions -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-GNU-DWARF |
| 12 |
// RUN: %clang_cc1 -triple i686-unknown-windows-gnu -fexceptions -exception-model=seh -fcxx-exceptions -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-GNU-SEH |
| 13 |
// RUN: %clang_cc1 -triple i686-unknown-windows-gnu -fexceptions -exception-model=sjlj -fcxx-exceptions -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-GNU-SJLJ |
| 14 |
|
| 15 |
// RUN: %clang_cc1 -triple powerpc-unknown-aix-xcoff -fexceptions -fcxx-exceptions -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-AIX |
| 16 |
// RUN: %clang_cc1 -triple powerpc64-unknown-aix-xcoff -fexceptions -fcxx-exceptions -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-AIX |
| 17 |
|
| 18 |
// RUN: %clang_cc1 -triple s390x-unknown-zos -fexceptions -fcxx-exceptions -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-ZOS |
| 19 |
// RUN: %clang_cc1 -triple systemz-unknown-zos -fexceptions -fcxx-exceptions -emit-llvm %s -o - | FileCheck %s -check-prefix CHECK-ZOS |
| 20 |
|
| 21 |
extern void g(); |
| 22 |
|
| 23 |
// CHECK-GNU: personality ptr @__gxx_personality_v0 |
| 24 |
// CHECK-GNU-DWARF: personality ptr @__gxx_personality_v0 |
| 25 |
// CHECK-GNU-SEH: personality ptr @__gxx_personality_seh0 |
| 26 |
// CHECK-GNU-SJLJ: personality ptr @__gxx_personality_sj0 |
| 27 |
|
| 28 |
// CHECK-WIN: personality ptr @__CxxFrameHandler3 |
| 29 |
|
| 30 |
// CHECK-AIX: personality ptr @__xlcxx_personality_v1 |
| 31 |
|
| 32 |
// CHECK-ZOS: personality ptr @__zos_cxx_personality_v2 |
| 33 |
|
| 34 |
void f() { |
| 35 |
try { |
| 36 |
g(); |
| 37 |
} catch (...) { |
| 38 |
} |
| 39 |
} |
| 40 |
|
| 41 |
#if defined(__SEH_EXCEPTIONS__) |
| 42 |
// CHECK-WIN-SEH-X86: personality ptr @_except_handler3 |
| 43 |
// CHECK-WIN-SEH-X64: personality ptr @__C_specific_handler |
| 44 |
|
| 45 |
void h(void) { |
| 46 |
__try { |
| 47 |
g(); |
| 48 |
} __finally { |
| 49 |
} |
| 50 |
} |
| 51 |
#endif |
| 52 |
|