1// RUN: %clang -fexceptions -fobjc-exceptions -S -emit-llvm %s -o /dev/null 2 3@interface Object { 4@public 5 Class isa; 6} 7+initialize; 8+alloc; 9+new; 10+free; 11-free; 12+(Class)class; 13-(Class)class; 14-init; 15-superclass; 16-(const char *)name; 17@end 18 19@interface Frob: Object 20@end 21 22@implementation Frob: Object 23@end 24 25static Frob* _connection = ((void *)0); 26 27extern void abort(void); 28 29void test (Object* sendPort) 30{ 31 int cleanupPorts = 1; 32 Frob* receivePort = ((void *)0); 33 34 @try { 35 receivePort = (Frob *) -1; 36 _connection = (Frob *) -1; 37 receivePort = ((void *)0); 38 sendPort = ((void *)0); 39 cleanupPorts = 0; 40 @throw [Object new]; 41 } 42 @catch(Frob *obj) { 43 if(!(0)) abort(); 44 } 45 @catch(id exc) { 46 if(!(!receivePort)) abort(); 47 if(!(!sendPort)) abort(); 48 if(!(!cleanupPorts)) abort(); 49 } 50} 51