summaryrefslogtreecommitdiffstats
path: root/test/Rewriter
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2010-09-17 15:54:40 +0000
committerdim <dim@FreeBSD.org>2010-09-17 15:54:40 +0000
commit36c49e3f258dced101949edabd72e9bc3f1dedc4 (patch)
tree0bbe07708f7571f8b5291f6d7b96c102b7c99dee /test/Rewriter
parentfc84956ac8b7cd244ef30e7a4d4d38a58dec5904 (diff)
downloadFreeBSD-src-36c49e3f258dced101949edabd72e9bc3f1dedc4.zip
FreeBSD-src-36c49e3f258dced101949edabd72e9bc3f1dedc4.tar.gz
Vendor import of clang r114020 (from the release_28 branch):
http://llvm.org/svn/llvm-project/cfe/branches/release_28@114020 Approved by: rpaulo (mentor)
Diffstat (limited to 'test/Rewriter')
-rw-r--r--test/Rewriter/rewrite-block-consts.mm19
-rw-r--r--test/Rewriter/rewrite-constructor-init.mm24
2 files changed, 43 insertions, 0 deletions
diff --git a/test/Rewriter/rewrite-block-consts.mm b/test/Rewriter/rewrite-block-consts.mm
new file mode 100644
index 0000000..c74873f
--- /dev/null
+++ b/test/Rewriter/rewrite-block-consts.mm
@@ -0,0 +1,19 @@
+// RUN: %clang_cc1 -x objective-c++ -Wno-return-type -fblocks -fms-extensions -rewrite-objc %s -o %t-rw.cpp
+// RUN: %clang_cc1 -fsyntax-only -fblocks -Wno-address-of-temporary -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp
+// rdar:// 8243071
+
+void x(int y) {}
+void f() {
+ const int bar = 3;
+ int baz = 4;
+ __block int bab = 4;
+ __block const int bas = 5;
+ void (^b)() = ^{
+ x(bar);
+ x(baz);
+ x(bab);
+ x(bas);
+ b();
+ };
+ b();
+}
diff --git a/test/Rewriter/rewrite-constructor-init.mm b/test/Rewriter/rewrite-constructor-init.mm
new file mode 100644
index 0000000..534e7fa
--- /dev/null
+++ b/test/Rewriter/rewrite-constructor-init.mm
@@ -0,0 +1,24 @@
+// RUN: %clang_cc1 -x objective-c++ -Wno-return-type -fblocks -fms-extensions -rewrite-objc %s -o %t-rw.cpp
+// RUN: %clang_cc1 -fsyntax-only -fblocks -Wno-address-of-temporary -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp
+// rdar : // 8213998
+
+typedef unsigned int NSUInteger;
+
+typedef struct _NSRange {
+ NSUInteger location;
+ NSUInteger length;
+} NSRange;
+
+static __inline NSRange NSMakeRange(NSUInteger loc, NSUInteger len) {
+ NSRange r;
+ r.location = loc;
+ r.length = len;
+ return r;
+}
+
+void bar() {
+ __block NSRange previousRange = NSMakeRange(0, 0);
+ void (^blk)() = ^{
+ previousRange = NSMakeRange(1, 0);
+ };
+}
OpenPOWER on IntegriCloud