summaryrefslogtreecommitdiffstats
path: root/llvm/test/FrontendObjC
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2009-01-26 23:22:19 +0000
committerDale Johannesen <dalej@apple.com>2009-01-26 23:22:19 +0000
commit03490f0ce1cf10a55a34e18af810995f4f013781 (patch)
treee66332822b517c1160a6f73bc6fca3ba3c329b41 /llvm/test/FrontendObjC
parent2612e149ef0ffcd73eee51e1e70671af4b5a0dd6 (diff)
downloadbcm5719-llvm-03490f0ce1cf10a55a34e18af810995f4f013781.tar.gz
bcm5719-llvm-03490f0ce1cf10a55a34e18af810995f4f013781.zip
Testcase for 6522054.
llvm-svn: 63067
Diffstat (limited to 'llvm/test/FrontendObjC')
-rw-r--r--llvm/test/FrontendObjC/2009-01-26-WriteBarrier-2.m14
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/test/FrontendObjC/2009-01-26-WriteBarrier-2.m b/llvm/test/FrontendObjC/2009-01-26-WriteBarrier-2.m
new file mode 100644
index 00000000000..32833a81e16
--- /dev/null
+++ b/llvm/test/FrontendObjC/2009-01-26-WriteBarrier-2.m
@@ -0,0 +1,14 @@
+// RUN: %llvmgcc -x objective-c -S %s -fobjc-gc -o - | grep objc_assign_strongCast
+// rdar://5541393
+
+typedef struct {
+ void (^ivarBlock)(void);
+} StructWithBlock_t;
+
+int main(char *argc, char *argv[]) {
+ StructWithBlock_t *swbp = (StructWithBlock_t *)malloc(sizeof(StructWithBlock_t*));
+ __block int i = 10;
+ // assigning a Block into an struct slot should elicit a write-barrier under GC
+ swbp->ivarBlock = ^ { ++i; };
+ return 0;
+}
OpenPOWER on IntegriCloud