aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2010-01-13 21:41:11 +0000
committerFariborz Jahanian <fjahanian@apple.com>2010-01-13 21:41:11 +0000
commitc75da518fde1f3b93643ac4e376ff2acd260facd (patch)
treed0a8564fe7918d3ce47f225101235d6b0bfad059 /test
parentb6ac2451bfed36206c5cec7217372c4299f67f2b (diff)
Fixes a rewrite bug rewriting a block call argument which has a trvial
constructor. Fixes radar 7537770. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93358 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Rewriter/rewrite-trivial-constructor.mm21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/Rewriter/rewrite-trivial-constructor.mm b/test/Rewriter/rewrite-trivial-constructor.mm
new file mode 100644
index 0000000000..81c7d9b8a7
--- /dev/null
+++ b/test/Rewriter/rewrite-trivial-constructor.mm
@@ -0,0 +1,21 @@
+// RUN: %clang_cc1 -fms-extensions -rewrite-objc -x objective-c++ -fblocks -o - %s
+// radar 7537770
+
+typedef struct {
+ int a;
+ int b;
+} s;
+
+extern void CFBasicHashApply(int (^block)(s)) {
+ int used, cnt;
+ for (int idx = 0; 0 < used && idx < cnt; idx++) {
+ s bkt;
+ if (0 < bkt.a) {
+ if (!block(bkt)) {
+ return;
+ }
+ used--;
+ }
+ }
+}
+