Add __block codegen testcase. We introduce a temporary flag to enable
codegen, until such time as codegen is complete enough to turn on with
-fblocks.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66031 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/CodeGen/blocks-1.c b/test/CodeGen/blocks-1.c
new file mode 100644
index 0000000..09f009c
--- /dev/null
+++ b/test/CodeGen/blocks-1.c
@@ -0,0 +1,14 @@
+// RUN: clang %s -emit-llvm -o %t -fblocks -f__block
+#include <stdio.h>
+
+int main() {
+ __block int a;
+ int b=2;
+ a=1;
+ printf("a is %d, b is %d\n", a, b);
+ ^{ a = 10; printf("a is %d, b is %d\n", a, b); }();
+ printf("a is %d, b is %d\n", a, b);
+ a = 1;
+ printf("a is %d, b is %d\n", a, b);
+ return 0;
+}