brintos

brintos / llvm-project-archived public Read only

0
0
Text · 555 B · cebb643 Raw
31 lines · plain
1#import <Foundation/Foundation.h>2 3@interface MyClass : NSObject {4};5-(void)test;6@end7 8@implementation MyClass9-(void)test {10    printf("%p\n", self); // break here11}12@end13 14@interface MyOwner : NSObject {15  @public id ownedThing; // should be id, to test <rdar://problem/31363513>16};17@end18 19@implementation MyOwner20@end21 22int main (int argc, char const *argv[]) {23    @autoreleasepool {24        MyOwner *owner = [[MyOwner alloc] init];25        owner->ownedThing = [[MyClass alloc] init];26        [(MyClass*)owner->ownedThing test];27    }28    return 0;29}30 31