[llvm-commits] [llvm] r57023 - /llvm/trunk/test/FrontendObjC++/2008-10-3-EhValue.mm

Evan Cheng evan.cheng at apple.com
Fri Oct 3 11:12:59 PDT 2008


Author: evancheng
Date: Fri Oct  3 13:12:59 2008
New Revision: 57023

URL: http://llvm.org/viewvc/llvm-project?rev=57023&view=rev
Log:
New test case.

Added:
    llvm/trunk/test/FrontendObjC++/2008-10-3-EhValue.mm

Added: llvm/trunk/test/FrontendObjC++/2008-10-3-EhValue.mm
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendObjC%2B%2B/2008-10-3-EhValue.mm?rev=57023&view=auto

==============================================================================
--- llvm/trunk/test/FrontendObjC++/2008-10-3-EhValue.mm (added)
+++ llvm/trunk/test/FrontendObjC++/2008-10-3-EhValue.mm Fri Oct  3 13:12:59 2008
@@ -0,0 +1,50 @@
+// RUN: %llvmgcc -w -x objective-c++ -c %s -o /dev/null
+
+ at interface Object {
+ at public
+     Class isa;
+}
++initialize;
++alloc;
++new;
++free;
+-free;
++(Class)class;
+-(Class)class;
+-init;
+-superclass;
+-(const char *)name;
+ at end
+
+ at interface Frob: Object
+ at end
+
+ at implementation Frob: Object
+ at 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();
+ }
+}





More information about the llvm-commits mailing list