| 1 |
// RUN: %clang_cc1 %std_cxx98-14 %s -triple=x86_64-apple-darwin10 -emit-llvm -o - -fcxx-exceptions -fexceptions | FileCheck %s --check-prefixes=CHECK,CHECK-PRE17 |
| 2 |
// RUN: %clang_cc1 %std_cxx17- %s -triple=x86_64-apple-darwin10 -Wno-dynamic-exception-spec -emit-llvm -o - -fcxx-exceptions -fexceptions | FileCheck %s --check-prefixes=CHECK,CHECK-17 |
| 3 |
|
| 4 |
void external(); |
| 5 |
|
| 6 |
// CHECK-LABEL: _Z6targetv( |
| 7 |
// CHECK: invoke void @_Z8externalv() |
| 8 |
// CHECK: landingpad { ptr, i32 } |
| 9 |
// CHECK-NEXT: filter [1 x ptr] [ptr @_ZTIi] |
| 10 |
// CHECK: call void @__cxa_call_unexpected |
| 11 |
void target() throw(int) |
| 12 |
{ |
| 13 |
external(); |
| 14 |
} |
| 15 |
|
| 16 |
// CHECK-LABEL: _Z7target2v( |
| 17 |
// CHECK: invoke void @_Z8externalv() |
| 18 |
// CHECK: landingpad { ptr, i32 } |
| 19 |
// CHECK-PRE17-NEXT: filter [0 x ptr] zeroinitializer |
| 20 |
// CHECK-17-NEXT: catch ptr null |
| 21 |
// CHECK-PRE17: call void @__cxa_call_unexpected |
| 22 |
// CHECK-17: call void @__clang_call_terminate |
| 23 |
void target2() throw() |
| 24 |
{ |
| 25 |
external(); |
| 26 |
} |