Only assignment operator triggers property setter call.
Fixes radar 8437253.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114207 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/CodeGenObjCXX/property-dot-copy.mm b/test/CodeGenObjCXX/property-dot-copy.mm
index 35321ad..9b23c58 100644
--- a/test/CodeGenObjCXX/property-dot-copy.mm
+++ b/test/CodeGenObjCXX/property-dot-copy.mm
@@ -32,3 +32,37 @@
return 0;
}
+
+// rdar: // 8437253
+extern "C" void exit(...);
+
+struct CGPoint {
+ float x;
+ float y;
+};
+typedef struct CGPoint CGPoint;
+
+extern "C" const CGPoint CGPointZero;
+
+bool operator==(const CGPoint& a, const CGPoint& b);
+
+@interface TIconViewSettings
+@property (assign, nonatomic) CGPoint gridOffset;
+@end
+
+@implementation TIconViewSettings
+- (CGPoint) gridOffset
+{
+ return CGPointZero;
+}
+
+- (void) foo
+{
+ if ((self.gridOffset) == CGPointZero)
+ exit(1);
+
+ if (self.gridOffset == CGPointZero)
+ exit(1);
+}
+@end
+