freebsd-nq/test/CodeGenObjC/objc2-write-barrier-5.m

30 lines
814 B
Mathematica
Raw Normal View History

2010-01-01 10:34:51 +00:00
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-gc -emit-llvm -o %t %s
2009-11-18 14:59:57 +00:00
// RUN: grep objc_assign_ivar %t | count 0
// RUN: grep objc_assign_strongCast %t | count 5
2010-05-27 15:17:06 +00:00
// RUN: %clang_cc1 -x objective-c++ -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
2009-10-14 18:03:49 +00:00
@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