Skip to content

Commit 668e91d

Browse files
committed
Test expansion of nested objc objects
1 parent 40aadad commit 668e91d

File tree

3 files changed

+19
-7
lines changed

3 files changed

+19
-7
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
OBJC_SOURCES := main.m
2-
2+
LD_EXTRAS := -framework Foundation
33
include Makefile.rules

lldb/test/API/commands/dwim-print/objc/TestDWIMPrintObjC.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,7 @@ class TestCase(TestBase):
1313
def test(self):
1414
self.build()
1515
lldbutil.run_to_source_breakpoint(self, "break here", lldb.SBFileSpec("main.m"))
16-
self.expect("dwim-print obj", substrs=["_number = 15"])
16+
self.expect("dwim-print parent", substrs=["_child = 0x"])
17+
self.expect(
18+
"dwim-print parent.child", patterns=[r'_name = 0x[0-9a-f]+ @"Seven"']
19+
)
Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,24 @@
11
#import <Foundation/Foundation.h>
22

3-
@interface Object : NSObject
4-
@property(nonatomic) int number;
3+
@interface Child : NSObject
4+
@property(nonatomic, copy) NSString *name;
55
@end
66

7-
@implementation Object
7+
@implementation Child
8+
@end
9+
10+
@interface Parent : NSObject
11+
@property(nonatomic, strong) Child *child;
12+
@end
13+
14+
@implementation Parent
815
@end
916

1017
int main(int argc, char **argv) {
11-
Object *obj = [Object new];
12-
obj.number = 15;
18+
Child *child = [Child new];
19+
child.name = @"Seven";
20+
Parent *parent = [Parent new];
21+
parent.child = child;
1322
puts("break here");
1423
return 0;
1524
}

0 commit comments

Comments
 (0)