Testcase for <rdar://problem/8824861>.
llvm-svn: 126968
diff --git a/SingleSource/UnitTests/ObjC/exceptions-4.m b/SingleSource/UnitTests/ObjC/exceptions-4.m
new file mode 100644
index 0000000..64154d7
--- /dev/null
+++ b/SingleSource/UnitTests/ObjC/exceptions-4.m
@@ -0,0 +1,22 @@
+#import <Foundation/Foundation.h>
+
+int main (int argc, const char * argv[]) {
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ NSMutableArray *array =
+ [NSMutableArray arrayWithObjects:@"One", @"Two", @"Three", nil];
+
+ BOOL enumerated = NO;
+ BOOL exceptionThrown = NO;
+ @try {
+ for (id obj in array) {
+ enumerated = YES;
+ [array removeLastObject];
+ }
+ } @catch (NSException *e) {
+ exceptionThrown = YES
+ }
+
+ assert(enumerated == YES && exceptionThrown == YES);
+ [pool drain];
+ return 0;
+}
diff --git a/SingleSource/UnitTests/ObjC/exceptions-4.reference_output b/SingleSource/UnitTests/ObjC/exceptions-4.reference_output
new file mode 100644
index 0000000..ca916d0
--- /dev/null
+++ b/SingleSource/UnitTests/ObjC/exceptions-4.reference_output
@@ -0,0 +1 @@
+exit 0