John McCall | d1e40d5 | 2011-10-02 01:16:38 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fexceptions -fobjc-exceptions -o - %s | FileCheck %s |
John McCall | 7ec404c | 2010-10-16 08:21:07 +0000 | [diff] [blame] | 2 | |
| 3 | // rdar://problem/8535238 |
| 4 | // CHECK: declare void @objc_exception_rethrow() |
| 5 | |
| 6 | void protos() { |
| 7 | extern void foo(); |
| 8 | @try { |
| 9 | foo(); |
| 10 | } @catch (id e) { |
| 11 | @throw; |
| 12 | } |
| 13 | } |
John McCall | fd186ac | 2010-10-16 16:34:08 +0000 | [diff] [blame] | 14 | |
| 15 | void throwing() { |
| 16 | @throw(@"error!"); |
| 17 | } |
John McCall | d768e9d | 2011-06-22 02:32:12 +0000 | [diff] [blame] | 18 | |
| 19 | // rdar://problem/9431547 |
| 20 | void die(void) __attribute__((nothrow, noreturn)); |
| 21 | void test2(void) { |
| 22 | @try { |
| 23 | die(); |
| 24 | } @finally { |
| 25 | extern void test2_helper(void); |
| 26 | test2_helper(); |
| 27 | } |
| 28 | |
| 29 | // CHECK: define void @test2() |
| 30 | // CHECK-NOT: call void @test2_helper() |
| 31 | } |