aboutsummaryrefslogtreecommitdiff
path: root/test/Rewriter
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2012-08-21 18:56:50 +0000
committerFariborz Jahanian <fjahanian@apple.com>2012-08-21 18:56:50 +0000
commita6e5a6e60ba744463819c1ee2595539c6055382b (patch)
tree5e10214a339044dda6c9b1de7c8d81fe074aa8d5 /test/Rewriter
parent377da4c6b78c0130fb6141313636c8fda7b60b72 (diff)
Modern objc translator: Fixes a crash in rewriter when rewriting the API
for structure valued method messaging. // rdar://12142241 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162303 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Rewriter')
-rw-r--r--test/Rewriter/objc-modern-StretAPI-2.mm30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/Rewriter/objc-modern-StretAPI-2.mm b/test/Rewriter/objc-modern-StretAPI-2.mm
new file mode 100644
index 0000000000..961fc168be
--- /dev/null
+++ b/test/Rewriter/objc-modern-StretAPI-2.mm
@@ -0,0 +1,30 @@
+// RUN: %clang_cc1 -x objective-c++ -fblocks -fms-extensions -rewrite-objc %s -o %t-rw.cpp
+// RUN: %clang_cc1 -fsyntax-only -fblocks -Wno-address-of-temporary -D"Class=void*" -D"id=void*" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp
+// rdar://12142241
+
+extern "C" void *sel_registerName(const char *);
+typedef unsigned long size_t;
+
+typedef unsigned long NSUInteger;
+typedef struct _NSRange {
+ NSUInteger location;
+ NSUInteger length;
+} NSRange;
+
+
+@interface NSIndexSet
+- (NSRange)rangeAtIndex:(NSUInteger)rangeIndex;
+@end
+
+@interface NSArray
+@end
+
+@implementation NSArray
+- (NSArray *)objectsAtIndexes:(NSIndexSet *)iset {
+
+ NSUInteger ridx = 0;
+ NSRange range = [iset rangeAtIndex:ridx];
+ return 0;
+}
+@end
+