summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenObjC
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2011-01-26 23:08:27 +0000
committerFariborz Jahanian <fjahanian@apple.com>2011-01-26 23:08:27 +0000
commit2f2fa7284bd949310b69692cbca921bbdac956a0 (patch)
tree8b240cd158892162850ccc42814b41f5991cc2f2 /clang/test/CodeGenObjC
parentfb4ee9bbde8b3f1511f245eaef996f3fcc3e4d6b (diff)
downloadbcm5719-llvm-2f2fa7284bd949310b69692cbca921bbdac956a0.tar.gz
bcm5719-llvm-2f2fa7284bd949310b69692cbca921bbdac956a0.zip
Fixes an IRgen bug where __block variable is
referenced in the block-literal initializer of that variable. // rdar://8893785 llvm-svn: 124332
Diffstat (limited to 'clang/test/CodeGenObjC')
-rw-r--r--clang/test/CodeGenObjC/block-6.m12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/CodeGenObjC/block-6.m b/clang/test/CodeGenObjC/block-6.m
new file mode 100644
index 00000000000..3720a87b9e5
--- /dev/null
+++ b/clang/test/CodeGenObjC/block-6.m
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 %s -emit-llvm -o - -fblocks -triple x86_64-apple-darwin10 | FileCheck %s
+// rdar://8893785
+
+void MYFUNC() {
+// CHECK: [[T1:%.*]] = bitcast i8* ()*
+// CHECK-NEXT: [[FORWARDING:%.*]] = getelementptr inbounds [[N_T:%.*]]* [[N:%.*]], i32 0, i32 1
+// CHECK-NEXT: [[T0:%.*]] = load [[N_T]]** [[FORWARDING]]
+// CHECK-NEXT: [[OBSERVER:%.*]] = getelementptr inbounds [[N_T]]* [[T0]], i32 0, i32 6
+// CHECK-NEXT: store i8* [[T1]], i8** [[OBSERVER]]
+ __block id observer = ^{ return observer; };
+}
+
OpenPOWER on IntegriCloud