diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/Rewriter/rewrite-trivial-constructor.mm | 21 |
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--; + } + } +} + |