[llvm-commits] [test-suite] r102205 - /test-suite/trunk/SingleSource/UnitTests/ObjC/exceptions-2.m

Daniel Dunbar daniel at zuster.org
Fri Apr 23 12:19:07 PDT 2010


Author: ddunbar
Date: Fri Apr 23 14:19:07 2010
New Revision: 102205

URL: http://llvm.org/viewvc/llvm-project?rev=102205&view=rev
Log:
Add an Objective-C EH test case, from <rdar://problem/7471679>.

Added:
    test-suite/trunk/SingleSource/UnitTests/ObjC/exceptions-2.m

Added: test-suite/trunk/SingleSource/UnitTests/ObjC/exceptions-2.m
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/UnitTests/ObjC/exceptions-2.m?rev=102205&view=auto
==============================================================================
--- test-suite/trunk/SingleSource/UnitTests/ObjC/exceptions-2.m (added)
+++ test-suite/trunk/SingleSource/UnitTests/ObjC/exceptions-2.m Fri Apr 23 14:19:07 2010
@@ -0,0 +1,24 @@
+#import <Foundation/Foundation.h>
+#import <assert.h>
+
+int main() {
+  int state = 0;
+  @try {
+    state++;
+    @try {
+      state++;
+      @throw [NSObject new];
+      assert(0);
+    } @catch(NSArray *e) {
+      assert(0);
+    }
+    assert(0);
+  } @catch (id e) {
+    state++;
+  }
+  assert(state == 3);
+
+  printf("OK\n");
+
+  return 0;
+}





More information about the llvm-commits mailing list