summaryrefslogtreecommitdiffstats
path: root/llvm/test/FrontendObjC
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-10-06 18:42:48 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-10-06 18:42:48 +0000
commitdd082cf676f2643f20a22663314f3799a33844be (patch)
treea57dec244662c673c4b45f067140543cb8b0ee3c /llvm/test/FrontendObjC
parent704a2505db2e07e0d876695b4fcd0d58064e43b8 (diff)
downloadbcm5719-llvm-dd082cf676f2643f20a22663314f3799a33844be.tar.gz
bcm5719-llvm-dd082cf676f2643f20a22663314f3799a33844be.zip
This is an objective-c test, not an objective-c++ one.
llvm-svn: 57193
Diffstat (limited to 'llvm/test/FrontendObjC')
-rw-r--r--llvm/test/FrontendObjC/2008-10-3-EhValue.mm50
1 files changed, 50 insertions, 0 deletions
diff --git a/llvm/test/FrontendObjC/2008-10-3-EhValue.mm b/llvm/test/FrontendObjC/2008-10-3-EhValue.mm
new file mode 100644
index 00000000000..a4c0cae075a
--- /dev/null
+++ b/llvm/test/FrontendObjC/2008-10-3-EhValue.mm
@@ -0,0 +1,50 @@
+// RUN: %llvmgcc -w -x objective-c -c %s -o /dev/null
+
+@interface Object {
+@public
+ Class isa;
+}
++initialize;
++alloc;
++new;
++free;
+-free;
++(Class)class;
+-(Class)class;
+-init;
+-superclass;
+-(const char *)name;
+@end
+
+@interface Frob: Object
+@end
+
+@implementation Frob: Object
+@end
+
+static Frob* _connection = ((void *)0);
+
+extern void abort(void);
+
+void test (Object* sendPort)
+{
+ int cleanupPorts = 1;
+ Frob* receivePort = ((void *)0);
+
+ @try {
+ receivePort = (Frob *) -1;
+ _connection = (Frob *) -1;
+ receivePort = ((void *)0);
+ sendPort = ((void *)0);
+ cleanupPorts = 0;
+ @throw [Object new];
+ }
+ @catch(Frob *obj) {
+ if(!(0)) abort();
+ }
+ @catch(id exc) {
+ if(!(!receivePort)) abort();
+ if(!(!sendPort)) abort();
+ if(!(!cleanupPorts)) abort();
+ }
+}
OpenPOWER on IntegriCloud