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