Testcase for 6522054.

llvm-svn: 63067
This commit is contained in:
Dale Johannesen 2009-01-26 23:22:19 +00:00
parent 2612e149ef
commit 03490f0ce1
1 changed files with 14 additions and 0 deletions

View File

@ -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;
}