52 lines · plain
1// RUN: %clang_cc1 -x objective-c++ -fblocks -fms-extensions -rewrite-objc -fobjc-runtime=macosx-fragile-10.5 %s -o %t-rw.cpp2// RUN: FileCheck -check-prefix CHECK-LP --input-file=%t-rw.cpp %s3 4@interface F {5 int supervar;6}7@end8 9@interface G : F {10@public11 int ivar;12}13@end14 15@implementation G16- (void)foo:(F *)arg {17 int q = arg->supervar;18 int v = ((G *)arg)->ivar;19}20@end21 22void objc_assign_strongCast(id);23void __CFAssignWithWriteBarrier(void **location, void *value) {24 objc_assign_strongCast((id)value);25}26 27@interface RealClass {28 @public29 int f;30}31@end32 33@implementation RealClass34@end35 36@interface Foo {37 id reserved;38}39@end40 41@implementation Foo42- (void)bar {43 ((RealClass*)reserved)->f = 99;44}45@end46 47// CHECK-LP: ((struct G_IMPL *)arg)->ivar48 49// CHECK-LP: objc_assign_strongCast((id)value)50 51// CHECK-LP: ((struct RealClass_IMPL *)((RealClass *)((struct Foo_IMPL *)self)->reserved))->f52