summaryrefslogtreecommitdiffstats
path: root/test/SemaCXX/blocks.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaCXX/blocks.cpp')
-rw-r--r--test/SemaCXX/blocks.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/SemaCXX/blocks.cpp b/test/SemaCXX/blocks.cpp
index baa79e7..adbff55 100644
--- a/test/SemaCXX/blocks.cpp
+++ b/test/SemaCXX/blocks.cpp
@@ -41,3 +41,30 @@ namespace test2 {
return Power(2).calculate(10);
}
}
+
+// rdar: // 8382559
+namespace radar8382559 {
+ void func(bool& outHasProperty);
+
+ int test3() {
+ __attribute__((__blocks__(byref))) bool hasProperty = false;
+ bool has = true;
+
+ bool (^b)() = ^ {
+ func(hasProperty);
+ if (hasProperty)
+ hasProperty = 0;
+ if (has)
+ hasProperty = 1;
+ return hasProperty;
+ };
+ func(hasProperty);
+ func(has);
+ b();
+ if (hasProperty)
+ hasProperty = 1;
+ if (has)
+ has = 2;
+ return hasProperty = 1;
+ }
+}
OpenPOWER on IntegriCloud