• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// RUN: %llvmgcc -x objective-c -S %s -fobjc-gc -o - | grep objc_assign_strongCast
2// rdar://5541393
3
4typedef struct {
5    void (^ivarBlock)(void);
6} StructWithBlock_t;
7
8int main(char *argc, char *argv[]) {
9   StructWithBlock_t *swbp = (StructWithBlock_t *)malloc(sizeof(StructWithBlock_t*));
10   __block   int i = 10;
11   // assigning a Block into an struct slot should elicit a write-barrier under GC
12   swbp->ivarBlock = ^ { ++i; };
13   return 0;
14}
15