diff --git a/lldb/test/API/lang/objc/objc-property/TestObjCProperty.py b/lldb/test/API/lang/objc/objc-property/TestObjCProperty.py --- a/lldb/test/API/lang/objc/objc-property/TestObjCProperty.py +++ b/lldb/test/API/lang/objc/objc-property/TestObjCProperty.py @@ -137,3 +137,8 @@ value = frame.EvaluateExpression("BaseClass.classInt", False) self.assertTrue(value.GetError().Success()) self.assertEquals(value.GetValueAsUnsigned(11111), 234) + + # Test that accessing two distinct class and instance properties that + # share the same name works. + self.expect_expr("mine.propConflict", result_value="4") + self.expect_expr("BaseClass.propConflict", result_value="6") diff --git a/lldb/test/API/lang/objc/objc-property/main.m b/lldb/test/API/lang/objc/objc-property/main.m --- a/lldb/test/API/lang/objc/objc-property/main.m +++ b/lldb/test/API/lang/objc/objc-property/main.m @@ -22,12 +22,16 @@ - (int) getAccessCount; ++ (int) propConflict; + +(BaseClass *) baseClassWithBackedInt: (int) inInt andUnbackedInt: (int) inOtherInt; @property(getter=myGetUnbackedInt,setter=mySetUnbackedInt:) int unbackedInt; @property int backedInt; @property (nonatomic, assign) id idWithProtocol; @property(class) int classInt; +@property(getter=propConflict,readonly) int propConflict; +@property(readonly,class) int propConflict; @end @implementation BaseClass @@ -85,6 +89,15 @@ { return _access_count; } + +- (int) propConflict +{ + return 4; +} ++ (int) propConflict +{ + return 6; +} @end typedef BaseClass TypedefBaseClass; @@ -94,6 +107,7 @@ { BaseClass *mine = [BaseClass baseClassWithBackedInt: 10 andUnbackedInt: 20]; TypedefBaseClass *typedefd = mine; + int propConflict = mine.propConflict + BaseClass.propConflict; // Set a breakpoint here. int nonexistant = mine.nonexistantInt;