aboutsummaryrefslogtreecommitdiff
path: root/packages/Python/lldbsuite/test/lang/objc/objc-dyn-sbtype/main.m
blob: f3587b52cd5fd873e71b558b82174f02abc97bdf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#import <Foundation/Foundation.h>

@interface MyBaseClass : NSObject
{}
-(id) init;
-(int) getInt;
@end

@implementation MyBaseClass
- (id) init {
	return (self = [super init]);
}

- (int) getInt {
	return 1;
}
@end

@interface MyDerivedClass : MyBaseClass
{
	int x;
	int y;
}
-(id) init;
-(int) getInt;
@end

@implementation MyDerivedClass
- (id) init {
	self = [super init];
	if (self) {
		self-> x = 0;
		self->y = 1;
	}
	return self;
}

- (int) getInt {
	y = x++;
	return x;
}
@end


int main (int argc, char const *argv[])
{
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];	
	NSObject* object = [[MyDerivedClass alloc] init];
	MyBaseClass* base = [[MyDerivedClass alloc] init];
    [pool release]; // Set breakpoint here.
    return 0;
}