1*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -fobjc-exceptions %s -o - | FileCheck %s 2*f4a2713aSLionel Sambuc 3*f4a2713aSLionel Sambuc 4*f4a2713aSLionel Sambucextern int printf(const char*, ...); 5*f4a2713aSLionel Sambuc 6*f4a2713aSLionel Sambucint main() 7*f4a2713aSLionel Sambuc{ 8*f4a2713aSLionel Sambuc @try { 9*f4a2713aSLionel Sambuc @throw @"foo"; 10*f4a2713aSLionel Sambuc } @catch (id e) { 11*f4a2713aSLionel Sambuc @try { 12*f4a2713aSLionel Sambuc// CHECK: call void @objc_exception_throw 13*f4a2713aSLionel Sambuc @throw; 14*f4a2713aSLionel Sambuc } @catch (id e) { 15*f4a2713aSLionel Sambuc if (e) { 16*f4a2713aSLionel Sambuc printf("caught \n"); 17*f4a2713aSLionel Sambuc } else { 18*f4a2713aSLionel Sambuc printf("caught (WRONG)\n"); 19*f4a2713aSLionel Sambuc } 20*f4a2713aSLionel Sambuc } @catch (...) { 21*f4a2713aSLionel Sambuc printf("caught nothing (WRONG)\n"); 22*f4a2713aSLionel Sambuc } 23*f4a2713aSLionel Sambuc } 24*f4a2713aSLionel Sambuc} 25*f4a2713aSLionel Sambuc 26