[llvm-commits] [llvm] r63067 - /llvm/trunk/test/FrontendObjC/2009-01-26-WriteBarrier-2.m
Dale Johannesen
dalej at apple.com
Mon Jan 26 15:22:20 PST 2009
Author: johannes
Date: Mon Jan 26 17:22:19 2009
New Revision: 63067
URL: http://llvm.org/viewvc/llvm-project?rev=63067&view=rev
Log:
Testcase for 6522054.
Added:
llvm/trunk/test/FrontendObjC/2009-01-26-WriteBarrier-2.m
Added: llvm/trunk/test/FrontendObjC/2009-01-26-WriteBarrier-2.m
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendObjC/2009-01-26-WriteBarrier-2.m?rev=63067&view=auto
==============================================================================
--- llvm/trunk/test/FrontendObjC/2009-01-26-WriteBarrier-2.m (added)
+++ llvm/trunk/test/FrontendObjC/2009-01-26-WriteBarrier-2.m Mon Jan 26 17:22:19 2009
@@ -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;
+}
More information about the llvm-commits
mailing list