summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2012-04-11 23:57:12 +0000
committerFariborz Jahanian <fjahanian@apple.com>2012-04-11 23:57:12 +0000
commit104dbf982582f16888fb15f9342fce9748af48c5 (patch)
tree30ea9fb55508d8d5ea19f9d5362a89e46c88b931 /test
parent16aac6f6eb31eb5118424773411867fc3cd5fbc6 (diff)
modern objective-c translator. Fixes a mis-translation when
of a __block struct object. // rdar://11230308 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154566 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Rewriter/rewrite-modern-block.mm18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/Rewriter/rewrite-modern-block.mm b/test/Rewriter/rewrite-modern-block.mm
new file mode 100644
index 0000000000..c5231bfceb
--- /dev/null
+++ b/test/Rewriter/rewrite-modern-block.mm
@@ -0,0 +1,18 @@
+// 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://11230308
+
+typedef struct {
+ char byte0;
+ char byte1;
+} CFUUIDBytes;
+
+void x(void *);
+
+void y() {
+ __block CFUUIDBytes bytes;
+
+ void (^bar)() = ^{
+ x(&bytes);
+ };
+}