mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-17 03:30:28 +00:00
15 lines
450 B
Mathematica
15 lines
450 B
Mathematica
|
// 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;
|
||
|
}
|