brintos

brintos / llvm-project-archived public Read only

0
0
Text · 612 B · 5ec1d65 Raw
46 lines · plain
1#import <Foundation/Foundation.h>2 3@interface A : NSObject4{5    int m_a;6}7-(id)init;8-(void)accessMember:(int)a;9+(void)accessStaticMember:(int)a;10@end11 12static int s_a = 5;13 14@implementation A15-(id)init16{17    self = [super init];18    19    if (self)20        m_a = 2;21 22    return self;23}24 25-(void)accessMember:(int)a26{27    m_a = a; // breakpoint 128}29 30+(void)accessStaticMember:(int)a31{32    s_a = a; // breakpoint 233}34@end35 36int main()37{38    NSAutoreleasePool *pool = [NSAutoreleasePool alloc];39    A *my_a = [[A alloc] init];40    41    [my_a accessMember:3];42    [A accessStaticMember:5];43    44    [pool release];45}46