diff options
author | Dale Johannesen <dalej@apple.com> | 2009-01-26 23:22:19 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2009-01-26 23:22:19 +0000 |
commit | 8bca3b76646ab19a69d8d50d3dcad9f2c82159bd (patch) | |
tree | 4a1b705d0b261eb37e4fa9de6cff6227a802cc69 | |
parent | 9de57a9ed2d401332eea0c02cdf0b6e66502be58 (diff) |
Testcase for 6522054.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63067 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | test/FrontendObjC/2009-01-26-WriteBarrier-2.m | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/FrontendObjC/2009-01-26-WriteBarrier-2.m b/test/FrontendObjC/2009-01-26-WriteBarrier-2.m new file mode 100644 index 0000000000..32833a81e1 --- /dev/null +++ b/test/FrontendObjC/2009-01-26-WriteBarrier-2.m @@ -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; +} |