diff options
| author | Fariborz Jahanian <fjahanian@apple.com> | 2009-09-30 17:10:29 +0000 |
|---|---|---|
| committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-09-30 17:10:29 +0000 |
| commit | e01e434aef4fd3190928f7e47331e6cb7f474e73 (patch) | |
| tree | fe250e1cd8e0c308578480dfae74f71be176ca68 /clang/test/CodeGenObjC | |
| parent | e0527b2de123ada4a9dce92ce14528b326eec30a (diff) | |
| download | bcm5719-llvm-e01e434aef4fd3190928f7e47331e6cb7f474e73.tar.gz bcm5719-llvm-e01e434aef4fd3190928f7e47331e6cb7f474e73.zip | |
<rdar://problem/7263113> Make clang produce gcc's objc_assign_StrongCast as a result of type-cast of an ivar in assignment.
llvm-svn: 83150
Diffstat (limited to 'clang/test/CodeGenObjC')
| -rw-r--r-- | clang/test/CodeGenObjC/objc2-write-barrier-5.m | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/clang/test/CodeGenObjC/objc2-write-barrier-5.m b/clang/test/CodeGenObjC/objc2-write-barrier-5.m new file mode 100644 index 00000000000..5b8f02cc1e1 --- /dev/null +++ b/clang/test/CodeGenObjC/objc2-write-barrier-5.m @@ -0,0 +1,27 @@ +// RUN: clang-cc -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o %t %s && +// RUN: grep objc_assign_ivar %t | count 0 && +// RUN: grep objc_assign_strongCast %t | count 5 && +// RUN: true + +@interface TestUnarchiver +{ + void *allUnarchivedObjects; +} +@end + +@implementation TestUnarchiver + +struct unarchive_list { + int ifield; + id *list; +}; + +- (id)init { + (*((struct unarchive_list *)allUnarchivedObjects)).list = 0; + ((struct unarchive_list *)allUnarchivedObjects)->list = 0; + (**((struct unarchive_list **)allUnarchivedObjects)).list = 0; + (*((struct unarchive_list **)allUnarchivedObjects))->list = 0; + return 0; +} + +@end |

