John McCall | 260611a | 2012-06-20 06:18:46 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -fobjc-exceptions %s -o - | FileCheck %s |
Fariborz Jahanian | 8c89ff9 | 2009-12-14 21:35:01 +0000 | [diff] [blame] | 2 | |
Fariborz Jahanian | 42f8d00 | 2009-12-14 22:17:35 +0000 | [diff] [blame] | 3 | |
| 4 | extern int printf(const char*, ...); |
Fariborz Jahanian | 8c89ff9 | 2009-12-14 21:35:01 +0000 | [diff] [blame] | 5 | |
| 6 | int main() |
| 7 | { |
| 8 | @try { |
| 9 | @throw @"foo"; |
| 10 | } @catch (id e) { |
| 11 | @try { |
| 12 | // CHECK: call void @objc_exception_throw |
| 13 | @throw; |
| 14 | } @catch (id e) { |
| 15 | if (e) { |
| 16 | printf("caught \n"); |
| 17 | } else { |
| 18 | printf("caught (WRONG)\n"); |
| 19 | } |
| 20 | } @catch (...) { |
| 21 | printf("caught nothing (WRONG)\n"); |
| 22 | } |
| 23 | } |
| 24 | } |
| 25 | |