llvm.org GIT mirror llvm / 8bca3b7
Testcase for 6522054. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63067 91177308-0d34-0410-b5e6-96231b3b80d8 Dale Johannesen 11 years ago
1 changed file(s) with 14 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 // RUN: %llvmgcc -x objective-c -S %s -fobjc-gc -o - | grep objc_assign_strongCast
1 // rdar://5541393
2
3 typedef struct {
4 void (^ivarBlock)(void);
5 } StructWithBlock_t;
6
7 int main(char *argc, char *argv[]) {
8 StructWithBlock_t *swbp = (StructWithBlock_t *)malloc(sizeof(StructWithBlock_t*));
9 __block int i = 10;
10 // assigning a Block into an struct slot should elicit a write-barrier under GC
11 swbp->ivarBlock = ^ { ++i; };
12 return 0;
13 }